Installing the MySql gem on a fresh Mac OSX Leopard machine

September 24th, 2008

Rails 2.2 deprecates the inbuilt Rails MySql driver and you are recommended to use the native MySql gem instead.

Unfortunately, when I tried to install this on my fresh Leopard box I got:

Error installing mysql:
ERROR: Failed to build gem native extension.

Followed by a load of guff about options.

After a bit of searching I found a post on the Rails blog with some potential alternative commands; mostly about Windows installations but also some for OSX.

Of these, only one worked for me – and that was:

sudo gem install mysql -- --with-mysql-config

Note that that is double-dash space double-dashwith-mysql-config.

Comments are closed.