Michael C Hogan

Agile Product Development & Innovation Strategy


Upgrading to Rails 3

Before starting with Ruby, it’s useful to have a copy of git on hand. Git is a software configuration management tool, available here. It’s widely used in the Ruby and Rails communities.

I visited the Ruby on Rails download page that has instructions and links to relevant information about RoR.

The page explains that I’ll need Ruby version 1.8.7 or 1.9.2. The following command checks to see what Ruby version I have installed on my Mac…

$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]

Next, I updated to the latest version of Ruby Gems. A gem is sort of like a ruby application. Rails is a gem.

$ sudo gem update --system

Since I met the system requirements for Rails 3, I continue with the Rails update command…

$ sudo gem update rails

This command took a while to run (maybe 10 minutes).

Finally, I needed to clean up old gems before rails would work. The next command handles cleanup by removing prior gem versions.

$ gem cleanup

Now let’s try generating an App.

$ rails new app_name
$ cd app_name
$ rails server

And we’re off and running with a Rails 3 application!

…Oh, all my old apps stopped working. I guess I should have looked into how to upgrade them first, but at least they were all demos. So nothing important was lost.