Jared McFarland

The musings of a 20-something old web developer.

« Back to blog

Got MySQL to work with Rails in Mac OS 10.6: Snow Leopard

After a huge headache, I found this post:

http://cho.hapgoods.com/wordpress/?p=158

And while the post didn't offer the solution I wanted, a comment by "synth" in that post did.  It boiled down to running: 

sudo env ARCHFLAGS="-Os -arch x86_64 -fno-common" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

The issue was in my choice of MySQL packages.  Snow Leopard has an entire 64-bit kernel, and so naturally, I chose the 64-bit MySQL package.  Mac OS X ships with a version of Ruby that is only 32-bit, and tries to compile with a 32-bit package.  You can force it to compile with the proper package by passing the above arguments to the installer.

Hope this helps someone!