HowTo: Use older gems

Now that Rails 2.1.1 is out, when you install using the gem, you get Rails 2.1.1. If you want to install an older version, like Rails 2.1.0, you need to specify the version:

sudo gem install rails –version 2.1.0

You’ll do this if you have some dependency on the older rails version. To make sure your app will run when you transfer to a different machine, freeze rails into the vendor directory:

rake rails:freeze:edge TAG=rel_2-1-0

Make sure that your environment.rb specifies the corresponding version.
Finally, you may want to create a new project using an older version of rails. You can do so by:

rails _2.1.0_ project_name

And apparently, you can use that trick for other gem-installed commands, like capistrano.

Follow

Get every new post delivered to your Inbox.