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 ~ $
I had the same problem and since I use Oh-My-Zsh it was a little bit more difficult to track if I have duplicate calls to RVM.
I fixed it by moving the call to RVM from the separate rvm.zsh file located in my \custom folder inside \oh-my-zsh to the very end of my main .zshrc file.
It looks like RVM is really sensitive to being called not at the end of your zsh initialization sequence.
My issue was resolved by changing:
PATH=/usr/local/bin
toPATH=$PATH:/usr/local/bin
in my.zshrc
source @github RVM issue queue
Obviously, you need to make sure RVM is properly installed first, and run the
type rvm | head -1
check that @choise suggested.rvm use --default 1.9.3-p362
now works properly.I had the same issue on Mac OS X 10.7.
And later I found that my account was not added to "rvm" group.
After I add myself to rvm group, I can set --default of rvm.
You need to put the path to rvm in front of your PATH
what does
type rvm | head -1
print out?in my bash_profile (on the latest osx) i had to put
i also created a gemset and setted this as default:
I had the same problem once. Turned out the rvm-script got loaded twice, which broke things a bit.
Check all the files that get loaded when you open a shell, e.g.
/etc/profile
,~/.bashrc
,~/.bash_profile
and so on, and make sure they don't load RVM twice.Maybe put
echo "Going to load RVM"
before[[ -s "/Users/user/.rvm/scripts/rvm" ]] && source "/Users/user/.rvm/scripts/rvm"
in your~/.bash_profile
to see if it happens or not