开发者

Installed RVM and tried to switch ruby version but no go

开发者 https://www.devze.com 2023-02-15 02:47 出处:网络
mlanza@mlanza-desktop:~$ rvm use 1.9.2 Using /home/mlanza/.rvm/gems/ruby-1.9.2-p180 mlanza@mlanza-desktop:~$ ruby -v
mlanza@mlanza-desktop:~$ rvm use 1.9.2
Using /home/mlanza/.rvm/gems/ruby-1.9.2-p180
mlanza@mlanza-desktop:~$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]

This is on Ubuntu 10.4 where 1.8.7 was already installed. Does RVM require that all Ruby versions be installed by it?

Do I have to set a PATH开发者_高级运维 variable in my .bashrc?


mlanza@mlanza-desktop:~$ rvm rvmrc trust
Marked /home/mlanza/.rvmrc as trusted
mlanza@mlanza-desktop:~$ [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
mlanza@mlanza-desktop:~$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux]


Make sure that

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

is the last thing in your ~/.bashrc file.

Also, reading the "Post install" docs might help, especially the troubleshooting section. However, usually we see people haven't added the above line to their startup script, or they've forgotten to set the default Ruby:

rvm use 1.9.2 --default

RVM doesn't require or expect that all Rubies on your system are under its control. Mac OS X includes Ruby for its own purposes, and RVM allows it to be used by issuing rvm use system. At that point RVM steps out of the way until you tell it to use one of its managed Rubies.

0

精彩评论

暂无评论...
验证码 换一张
取 消