Ubuntu11.
我做了以下工作:
$ rvm --default use 1.9.2
Using /home/md/.rvm/gems/ruby-1.9.2-p180
但当我现在打开一个新的终端窗口时,我仍然得到:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
Ubuntu11.
我做了以下工作:
$ rvm --default use 1.9.2
Using /home/md/.rvm/gems/ruby-1.9.2-p180
但当我现在打开一个新的终端窗口时,我仍然得到:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
如果将RVM源代码行放在bashrc中(以确保非交互式Shell可以访问RVM),则需要进行源代码转换.从你的.bash_配置文件,以下是您的最后一行.bash_简介
if [ -f "$HOME/.bashrc" ]; then
source $HOME/.bashrc
fi
这假设你有
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
在你的$HOME/里.巴什尔.这是确保交互式/登录和非交互式Shell都能正确查找和加载RVM的好方法.多用户安装通过/etc/profile完成相同的任务.d/rvm.sh文件.
在那之后,定义一个默认的Ruby来使用via应该没有问题
rvm 1.9.2 --default
或
rvm use 1.9.2@mygemset --default
Its better to define a default gemset to use so as not to pollute your 'default' 或 'global' gemsets.
如果您使用的是非交互式Shell,请注意它们通常在SH兼容模式下运行,这需要您设置
BASH_ENV="$HOME/.bashrc"
in your $HOME/.profile in 或der you load RVM, 或 to set that within your script directly. The reason f或 this is that when bash is operating in SH mode it does not directly load .bash_profile 或 .bashrc as SH doesn't use those files, and bash is attempting to mimic the loading and execution process of the SH shell.