24 Aug

Installing Ruby 1.9 on OS/X 10.5.7

OS/X comes with Ruby 1.8.6 pre-installed which is brilliant but updating it not so straightforward, also anyone attempting a gem update -system will end up with a lovely broken system. To fix this and since Ruby 1.9 is so much faster here’s a short guide on how to clean up your system and end up with single Ruby 1.9 install with gems that update nicely.

First, remove all the old files

I suggest making a note of your existing gems so you can install them again afterward):

sudo rm -r /System/Library/Frameworks/Ruby.framework/
sudo rm -r /Library/Ruby
sudo rm /usr/bin/ruby
sudo rm /usr/bin/gem

Install MacPorts

Brings the greatness of BSD Unix of OS/X - MacPorts.

Install Ruby 1.9

sudo port install ruby19 +nosuffix

Et voila

Ruby 1.9 nicely installed via MacPorts. Ruby 1.9 has RubyGems built in so need to install that separately. Just gem install your required gems. My only caveat is that some gems don’t seem to install their dependencies but this is easily solved by explicitly installing them. Apart from that all should work bar some possibly PATH issues (I had to point TextMate at /opt/local/bin to get the in-editor interpreter working).

There once was a time when all people believed in God and the church ruled. This time was called the Dark Ages.

--- Richard Lederer

salin.org