After using Ruby and Rails for quite some time now, i wanted to try RVM. Everything works fine, except for one thing:
In a freshly opened Terminal ruby
points to the system's ruby, despite the fact, that I used the rvm --default
command.
user@terra ~ $ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10]
user@terra ~ $ which ruby
/opt/local/bin/ruby
user@terra ~ $ rvm list
ruby-1.8.7-p334 [ ]
=> ruby-1.9.2-p180 [ ]
Everything is fine after I call rvm reload
user@terra ~ $ rvm reload
user@terra ~ $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.7.1]
tmangner@terra ~ $ which ruby
/Users/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
I've set up my .bash_profile
as described in the documentation:
...
[[ -s "/Users/user/.rvm/scripts/rvm" ]] && source "/Users/user/.rvm/scripts/rvm"
Thanks for your help. It is highly appreciated.
I'm using Mac OS X Snow Leopard (10.6.6)
Update:
That --default
does not seem to work for me ...
user@terra ~ $ rvm use 1.9.2 --default
Using /Users/user/.rvm/gems/ruby-1.9.2-p180
user@terra ~ $ rvm default
user@terra ~ $
A possible fix for ZSH users:
Somehow I had:
in both .zprofile and .zshrc.
Removing the line from .zprofile resolved the issue. (Though you should be able to remove from either, as long as it appears just once)
I had the same problem. Moving the line:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
after the line from MacPorts:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
solved the problem for me.
same pb here. line was there twice and it broke it.... for whatever reason... removing the extraneous line solved it
Moving this:
in the bottom of ~/.bash_profile solved the problem for me.
Instead of:
I used the full version:
That worked for me in zsh.
sanity check - make sure that the project you are working on has the same ruby version that you try to set as default in the .ruby-version file.
it happened to me, and i couldn't figure out why
rvm
doesn't use my default