Thursday 20 March 2008

Gotcha when upgrading rails on Mac OS X Leopard

One of the first things I did when receiving my new MacBook was to upgrade the Rails installation to 2.0.2, the standard installation of Rails on Leopard is 1.2.6.

Updating is simple, so long as you remember one little "gotcha".
$sudo gem update --system
$sudo gem update

Now here is the gotcha. Rails 2.0.X now has an new element, active resource, which is not upgrade by the standard upgrade path.
If you get the following error then its likely that you hav'nt updated rails properly.
$ rails
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:379:in `report_activate_error': Could not find RubyGem activeresource (= 2.0.2.9053) (Gem::LoadError)

so the solution is to either...
$sudo gem install rails

or
$sudo gem install activeresource


You dont need to use --include-dependancies anymore, its the default on the current version of rubygems.

Note also that the standard rails distribution on Leopard does not include a mysql driver, i will produce a post on how to upgrade this later.

3 comments:

Unknown said...

Thanks; that was driving me nuts. :-)

Oracleman said...

I agree with you Jay. Tim saved the day. Thanks, Tim.

Unknown said...

Thaks a lot !!!! 2 days i tried to upgrade from 1.2.6 to 2.0 ;)