2014-09-18 53 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