Fixing the Broken Gem Update Chain on Mac OS X 10.5

After a long time when I had no chance working on rails projects I wanted to update Rails for diving into the changes and new features of the new 2.2 version. Because of Rails now needs gem version 1.3.x and I still had 1.1.0 running, I started a gem update:

$ sudo gem update --system

Updating RubyGems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Updating rubygems-update
ERROR:  While executing gem ... (Gem::GemNotFoundException)
    could not find rubygems-update locally or in a repository

Oops. After reading some posts on the net that mainly covered the problem of gem erroneously stating that there is nothing to update, and which was not the case here, I stumpled upon a posting, which led me to the recipe described here (at least for my own further reference).

Working on Mac OS X 10.5.5 (at the time of writing) it goes like this:

  1. Download the rubygems-update gem of the desired target version, e. g. from http://gems.rubyforge.vm.bytemark.co.uk/gems/, to a directory of Your choice.
  2. In a Terminal window (or iTerm or whatever Your preferred shell CLI is) cd into the directory and issue the following commands:
  3. $ sudo gem install -l rubygems-update-1.3.1.gem # actual version's name of file You downloaded

  4. $ sudo update_rubygems # important!! (NOT gem update --system)

  5. Check version:

    $ gem --version
    
    1.3.1
    

Afterwards a "gem update" should behave as usual. Although described for the mentioned operating system this should work on Ubuntu Linux (and others using the sudo mechanism) as well.

Go Top