Working in Rails 2 & 3 with rvm

I had wanted to play with Rails 2 a bit, without breaking any of the Rails 3 apps I’m working on. I use rvm anyway, so I thought it would be pretty straightforward. I found instructions for setting it up, but ran into a couple snags.

First I installed Ruby 1.8.7 and created a gemset.

Then installed rails 2.3.11:

The first problem I ran into was that rvm had put rake 10.0.4 in the global gemset for ruby 1.8.7. This caused an error when running rake tasks:

To fix this:

It was also using the latest rubygems. This caused another error when running the gems:install rake task:

To fix:

Now you should be able to play. You may want to brush up on the differences between Rails 2 and 3 if it’s been a while.

[uncomment the sqlite3-ruby line in config/environment.rb]

Voilà.

Pro tip: set up an rvmrc for your Rails 2 projects so rvm automatically loads the correct ruby version & gemset when you cd into the directory.

About Alexander

Alexander has been programming for a very long time. When he met Ruby, it was love at first sight.
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *