1
votes

I'm running latest Snow Leopard and ran into a problem with ruby versions.

Version 1.8.7 was installed on Mac from the beginning. I installed 1.9.2 using RVM following all instructions. Now when I try to switch to 1.9.2 running rvm use 1.9.2 it says "using 1.9.2" but when I run ruby -v I still get 1.8.7

Seems like preinstalled version of ruby is not under RVM management.

Any ideas on how to get this fixed?

1
I think I had a similar problem once! What about uninstalling the 1.8.7 and reinstalling it using RVM? - Amokrane Chentir
Sounds like the preinstalled version appears earlier in your PATH than the rvm version. Is the line that sources rvm the last thing in your bash_profile or bashrc? - matt
@matt, my bash_profile looks like this: export PATH=~/.rvm/bin/:$PATH export PATH=/opt/local/bin/:$PATH - igorti
Have a look at the Post Install section here: rvm.beginrescueend.com/rvm/install Basically you need to remove the export PATH=~/.rvm/bin/:$PATH line and add [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to the end of bash_profile. - matt

1 Answers

3
votes

Seems like preinstalled version of ruby is not under RVM management

That is correct. It was preinstalled by Apple, and RVM will not manage it. To revert to using it you can do rvm system or rvm use system, and RVM will step out of the way. You can switch back using rvm default if you defined a default, or rvm 1.9.2 or rvm 1.8.7 if you installed one of those versions using RVM.

And, as a caution, Apple installed 1.8.7 to be used by some of their pre-installed apps. Do not mess with that installation or those apps could stop working, which you probably won't notice until farther down the road when you've forgotten you messed around, and can't figure out why they're broken.

As for why you still see 1.8.7 as your default:

  • Did you add [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to your ~/.bashrc OR ~/.bash_profile? See the Post Install section on RVM's installation page and follow the instructions.
  • Did you do rvm use 1.9.2 --default to define a default Ruby to use?