Installing the MySql gem on a fresh Mac OSX Leopard machine

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.

This entry was posted on Wednesday, September 24th, 2008 at 2:18 pm and is filed under Ruby on Rails and Software Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply