How do I switch to older versions of the ruby/rails environment? How do I switch to older versions of the ruby/rails environment? ruby ruby

How do I switch to older versions of the ruby/rails environment?


Try,

rvm use <ruby version>rvm gemset create rails2.3.2rvm <ruby version>@rails2.3.2gem install rails --version=2.3.2

Finally the syntax to create a new rails app in older versions of rails was just:

rails <appanme>

For more information about gemsets:RVM: Named Gem Sets


This will install Ruby 1.8.7 and then create a gemset that will contain only a specific set of gems:

rvm install 1.8.7rvm --create use 1.8.7@old_railsgem install rails --version=2.3.2

Whenever you want to use this after the first time just:

rvm use 1.8.7@old_rails

.rvmrc files are really useful for automatically managing different sets of Ruby versions and gems. If you create file called .rvmrc in the project directory and put this line in it:

rvm --create use 1.8.7@old_rails

Then every time you cd into that directory RVM will switch to Ruby 1.8.7 and the gemset "old_rails". Have a look at the docs for .rvmrc here: http://rvm.beginrescueend.com/workflow/rvmrc/

Of course you can change "1.8.7" for "1.8.6", "1.8.7-p249", "ree-1.8.7-2010.02" or any other Ruby version you like, I just assumed that you would want 1.8.7.