2014-09-18 27 views
-1

默认版本,当我做ruby -v它显示如何设置RVM红宝石作为系统

The program 'ruby' can be found in the following packages: 
* ruby1.8 
* ruby1.9.1 
Try: sudo apt-get install <selected package> 

You need to change your terminal emulator preferences to allow login shell. 
Sometimes it is required to use `/bin/bash --login` as the command. 
Please visit https://rvm.io/integration/gnome-terminal/ for an example. 

,当我运行/bin/bash --login,然后运行ruby -v它显示

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux] 

但我不想运行/bin/bash --login命令时间。我希望我的系统将ruby 2.1.0设置为rvm的默认ruby。

回答

0

问题可能是您的登录上下文。这是因为默认情况下,ssh使用与本地bash shell不同的启动上下文。在这里看到:

.bashrc at ssh login

你需要添加下面对.bash_profile:

if [ -f ~/.bashrc ]; then 
    . ~/.bashrc 
fi 

如果你使用sudo苏等,改变背景下,那么你就必须添加-l标志来建立相同的上下文。

这个答案只是一个猜测,很难说出为什么你的特定环境没有加载,但这是一个常见原因。

+0

感谢您的快速回复。你能告诉我如何编辑.bash_profile吗? – 2014-09-18 18:11:22

+0

@AkhilSharma使用任何文本编辑器 – 2014-09-18 18:13:02

+0

但它位于系统中的位置? – 2014-09-18 18:14:36