Search code examples
ruby-on-railsrubyruby-on-rails-3multiple-versions

How can I use multiple versions of rails in the same machine


I have installed rails 3.0.10 and 2.3.5 in my machine. I wanna shuffle between them but I am unable to use 2.3.5. When I run a command, the system recognizes only 3.0.10.


Solution

  • rvm lets you easily manage multiple installs of Ruby, each with their own list of gemsets.

    Edit: Based on your comment about looking into gemsets, I'll point out one of the single coolest features with rvm. Once you get your gemset setup, create a .rvmrc file in your Rails root directory. Add the following to it:

    rvm 1.9.2@foo

    Where "1.9.2" is whatever Ruby you're using and "foo" is the gemset name. rvm will automatically start using this set when you cd in to that directory.