How can I install different versions of Rails and keep the existing ones?
ruby-on-rails
Solution
`gem list rails` should show you all installed versions of Rails. You can specify which one you want each project to use in the `config/environment.rb` file.
Alternately (or "additionally"), look in to RVM (particularly the "gemset" function) for maintaining separate gem sets for each project.
Updated May 2017 Instead of RVM gemsets, best practice for managing gems in Rails projects (including the Rails gem itself) is to use Bundler. Bundler's Gemfile will list all the gems your project uses, and allows you to "pin" versions, so by changing the version pin for Rails and running `bundle` you can update your project to the new version.
`<sarcasm>`Now that I've said that, though, Bundler is probably on the way out to be replaced by something else. `</sarcasm>`
Problem
I had Rails 2.3.5 installed, and wanted to upgrade to 2.3.10 as a stepping stone to Rails 3. I thought running `gem install rails -v=2.3.10` would install 2.3.10 and keep 2.3.5 as well. But now when I do `rails -v`, it only lists Rails 2.3.10. How can I install different versions of Rails and keep the existing ones?