Systeme D

21 May 2008

Installing Ruby and MySQL on a G5 running Leopard

I'm coming to the conclusion that Leopard is no easier than Panther to install Unixy stuff on, and a whole load harder than Tiger. But after many fruitless hours last night trying to get Ruby and MySQL to talk to each other via the mysql gem, here's what I've now found.

The good news is that you can use the version of Ruby that ships with Leopard - no need to recompile.

However, for a G5 machine, you need to download the right version of MySQL. Not the version "for Mac OS 10.5", because this is Intel-only. And not the "64-bit PowerPC" version, though this might seem obvious.

No, you need to download and install the 32-bit PowerPC version for OS X 10.4. I know, I know, it's not exactly intuitive.

You can then install the Ruby mysql gem like this:

sudo env ARCHFLAGS="-arch ppc" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Again, note ppc, not ppc64. You can then test that it works happily by going into irb and typing require 'mysql' - it should simply return true.

(Dear Mr Google, kindly index this post to save others the wasted hours I had trying to figure out how to install. Thanks awfy.)


Comments


Add a comment

Your name:

E-mail address: 

Comment:

your comment. (E-mail addresses will not be visible, but a server-based mail link will be provided. To guard against spam, no comments which include 'http' or 'www' will be published.)