Tuesday, August 02, 2005

Setting up Ruby on Rails on Mac OS X Tiger

So the bird's iBook arrived a couple of days ago (yes Aussie teachers get cool laptops whilst us techies are left to our own means) and I suddenly see what all the fuss was about. Windows has gradually been getting me down with how slow and fragile it is. All I can say about the Mac (as has been said many times before) is "it just works". From someone who hated and did not understand Macs a week ago, I have fallen head over heels - especially with Tiger.

However, Tiger did ship with a version of the mysql ruby gem that just doesn't work - very slack considering the current coolade buzz. Luckily I had played around with Ruby on Rails enough on the (now defunct) Windows box to realise that it was worth investing an evening finding a solution. I had already installed Mysql so the solutions was as follows:

  • Install the latest Xcode - downloaded from the Mac site
  • Run: curl -O rufy.com/fix-ruby-tiger.sh; sh fix-ruby-tiger.sh
  • Download the latest ruby mysql source from http://www.tmtm.org/en/mysql/ruby/
  • Unzip, untar the folder, navigate to it, then type the following:
  • ruby extconf.rb --with-mysql-config
  • sudo make install
Some sites suggest that you compile with gcc 3.3 before performing these steps (sudo gcc_select 3.3). I found that this does not work at all. You now need to run with 4.0. Hope this helps. It certainly will help me when I order a new PowerBook - I am just too jealous of the iBook!