uses an older version that you are not ready to bring up to date. What do you do?
By default gem will keep older versions of installed gems until you tell it not to. To see what you have installed:
$ gem list --local
rails (2.1.0, 1.2.3, 1.2.1)
To use a specific version in your application add a line like this to the bottom of your config/environment.rb file
RAILS_GEM_VERSION = '1.2.3'
That should just work.
You can get rid of old versions of gems with this command:
$ gem cleanup
If you remove an old version by mistake you can always reinstall it with this gem command:
$ sudo gem install rails --version 1.2.3
When you are ready to move your application to the current version of rails then remove the line from environment.rb and bring your application files up to date with:
$ rake rails:update
Now, let's say you have installed the current version of Rails (say, 2.1.0) but you need to build an application that uses an older version. According to 'rails --help' there is no way to specify a version to use. It turns out that there is a hidden option available that does this:
$ rails _1.2.6_ myapp
Simple! Why this isn't explicitly documented I don't know. I found out about it from this post: http://rubybook.ca/2008/08/06/downgrade-older-version-rails/. Obviously you need to have the older version of Rails available on your system.