6

On opening a new terminal window (Mac OSX 10.7.2) and entering rails, I get the always fun 'rails is not currently installed..." message. But I enter rvm use default 1.9.2 and all is good with the world.

Where did I go wrong?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
KevDog
  • 5,763
  • 9
  • 42
  • 73
  • 1
    Have you checked http://stackoverflow.com/questions/4976861/rvm-settings-lost-after-every-logout or http://stackoverflow.com/questions/6924175/rvm-not-found-after-successful-usage-and-a-few-days-later – Mattias Wadman Nov 06 '11 at 11:49
  • 6
    The command is `rvm use 1.9.2 --default`. – Zabba Nov 06 '11 at 14:13
  • @MattiasWadman, it was in my path, Zabba was on the right track. – KevDog Nov 06 '11 at 23:27

1 Answers1

12

Zabba is right in the comments when he says the correct command to use is rvm use 1.9.2 --default.

RVM considers default to be a Ruby, equivalent to the Ruby set to the default. If I type rvm use default into my terminal, I get this output:

$ rvm use default
Using /Users/tom/.rvm/gems/ruby-1.9.3-p0

However, there is the ability to list multiple Rubies in your call to rvm use, e.g:

$ rvm use 1.9.3 system
Now using system ruby.

$ rvm use system 1.9.3
Using /Users/tom/.rvm/gems/ruby-1.9.3-p0

Although I am not entirely sure whether this is a feature (or the particular use case for passing multiple Rubies since RVM doesn't appear to fall back on the other listed Ruby if the last one isn't installed), it means that when you type rvm use default 1.9.2, rather than setting the default to 1.9.2, you are telling RVM to use 1.9.2, since it is the last Ruby listed in the command.

If you run the command rvm use 1.9.2 --default once, you will then be using 1.9.2 in every terminal you open.

NB on the multiple-arguments-to-rvm-use-feature: I know that you can pass multiple Rubies to the RVM command to run a script with multiple versions of Ruby but I can't see RVM setting two versions of Ruby to run at once.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
nobody
  • 1,782
  • 17
  • 28
  • I was thrown off by the fact that what I was doing worked, at least for that session. Thanks! – KevDog Nov 06 '11 at 23:26