This is a simple question, but I cannot seem to find a good answer in the docs (I’m a newbie with RVM).
What is the difference between rvm use ruby-1.9.2-head@rails3 and rvm ruby-1.9.2-head@rails3?
Was trying to setup two versions of my gemsets for 2 projects (rails 3.1 and 3.0.9) and was going to do:
rvm gemset create proj1 proj2
rvm 1.9.2-head@proj1
gem install rails -v 3.1
rvm 1.9.2-head@proj2
gem install rails -v 3.0.9
and then trying to figure out whether to use
rvm 1.9.2-head@proj1
or
rvm use 1.9.2-head@proj1
to switch to that project/gemset. Hence my question…
AFAIK, the rvm command alone is meant to be used to run something against multiple versions of ruby/ruby gems. For example, you can specify
rvm 1.9.2,1.8.7 test.rband it will execute test.rb using both rubies.In contrast,
rvm usesets up your current shell environment to use whatever ruby you’ve passed. so if yourvm use 1.9.2@proj1, your next ruby command can simply beruby whatever.rb, and rvm will pick ruby 1.9.2 using your proj1 gem set.so, to sum it up, use
rvm 1.9.2,1.8.7 something.rbwhen you want to run against multiple rubies, uservm use 1.9.2when you want to set the ruby your current shell will use.EDIT
This would’ve just looked terrible in a comment, so I’m editing instead. My output from those rvm commands looks like: