Rails, MySQL and Snow Leopard Rails, MySQL and Snow Leopard ruby-on-rails ruby-on-rails

Rails, MySQL and Snow Leopard


I just went through the same pain... here's what worked for me:

  1. Download / install the 64-bit MySQL 5.1.37 from mysql.com
  2. run the following commands:
    sudo gem update --system    sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

I also uninstalled all mysql gems that were floating around from my 10.5 days, that may do it if the above doesn't work for you :)


Rebuilding mysql as 64bit or installing the 64bit version is important, but you also need to make sure you build the native parts of the mysql gem as 64bit as well (this doesn't apply if you are on one of the original Intel Core Duo macs).

Here's the magic command:

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

You should set the ARCHFLAGS as shown above whenever you do a gem install with native components on Snow Leopard.


If you're using bundler, you can use "bundle config" to set the proper build arguments for mysql like so:

bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config