Leopard is out and it’s generally good aside from a few minor hiccups, surprises and unexpected changes deeper down in the OS affecting the Unix core.
One such hiccup is that the native bindings that allow Ruby and MySQL to communicate are a bit harder to get working than in Tiger unless you happened to just go a straight upgrade to Leopard in which case they should still be working.
MySQL’s binaries should install just fine in Leopard, but be sure to stick with version 5.0.37 of the Community Server for the time being. The two newer builds appear to be broken. You can download version 5.0.37 from here: http://downloads.mysql.com/archives.php?p=mysql-5.0&v=5.0.37.
Once you’ve got that installed along with the Xcode Developer Tools (found on your Leopard DVDs in the Optional Installs folder) you are ready to fire up the Terminal and install the MySQL Gem. You’ll be prompted for your admin password after the first command.
sudo -s ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql
If you’re on a PPC system, just replace `-arch i386` with `-arch ppc` and you should be good to go.
So say you…
This doesn’t work for me on my G4 PPC system. I get the same error I’ve seen others report when googling about this problem. By the way I had no problem on my other, Intel machine. Darn Apple for not including mysql for ruby! Here’s the error report Sorry, this comment system messes the formatting..
Mike O'Connor November 5, 2007
Mike - what version of MySQL do you have installed? What about the Xcode tools? I’m assuming you’re also using Tiger (10.4)? Or Leopard on the G4?
Scott November 5, 2007
I’m using Leopard Server with its supplied MySQL and XCode on this Dual 1GHz G4 (which runs Leopard surprisingly well with its 1.5GB RAM) But getting the mysql extension on it is a big problem (and was with Tiger too)
Mike O'Connor November 6, 2007
Hm. Interesting. Might be related to the fact that MySQL is not in the usual install location. I could have sworn that an older build of Leopard did include the MySQL gem by default. I remember testing it and checking what gems came fresh out of the box.
My Leopard Server disc hasn’t arrived yet but unless you find an answer in the meantime, I’ll make a note to check on that when it does.
Scott November 6, 2007
Mike - I took at look at Leopard Server, and although I haven’t actually installed it anywhere (yet), MySQL is installed under the /usr directory path. I think you should be able to compile the MySQL Ruby bindings by using
if you do happen to try it and it works - let me know and I will update the post so other people might benefit from that knowledge.
Scott November 8, 2007