Updating RubyGems on Mac OS X Leopard

The difference between updating installed gems and updating the RubyGems system itself on Leopard.

From the archivesWriting from an earlier age of the Internet, recovered from holyarmy.org.
Editor's note, 2026: This command targets Apple's system Ruby in Mac OS X 10.5. Do not use it to modify the system Ruby on a current Mac.

I’m just posting a simple tip today.

I was wanting to play around with the very cool SASS meta-language using Compass. The language and tool are implemented in Ruby, which is pre-installed on OS X, but as I discovered, I needed a newer version of RubyGems.

I had already known I needed to update Gems, so I was doing the following:

$ sudo gem update

Eventually I got errors like this:

Updating installed gems...
Bulk updating Gem source index for: http://gems.rubyforge.org
Bulk updating Gem source index for: http://gems.github.com/
Attempting remote update of RedCloth
ERROR:  Error installing RedCloth:
    RedCloth requires RubyGems version >= 1.2
Attempting remote update of capistrano
ERROR:  Error installing capistrano:
    capistrano requires RubyGems version >= 1.2
Attempting remote update of net-sftp
ERROR:  Error installing net-sftp:
    net-sftp requires RubyGems version >= 1.2
Attempting remote update of net-ssh
ERROR:  Error installing net-ssh:
    net-ssh requires RubyGems version >= 1.2
Gems updated: RedCloth, capistrano, net-sftp, net-ssh

Turns out, to update RubyGems, one must update the gem system!

So, the next correct command to run is:

$ sudo gem update --system

This updated my RubyGems to version 1.3.1 and allowed me to move forward in playing with Ruby.