After running a update of all gems on OsX 10.6 my old ruby programs using MySql stopped working, complaining of a old (or non-existent) “mysql” gem.
Trying to install it gave the following errors :
sh-3.2# gem install mysql
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
checking for mysql_ssl_set()… no
checking for rb_str_set_len()… no
checking for rb_thread_start_timer()… no
checking for mysql.h… no
checking for mysql/mysql.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for moredetails. You may need configuration options.
In the end I reinstalled the MySQL native client using MacPorts
(port install mysql) – and as it now resides in a set of directories that Ruby does not necessarily know I had to use the following to install the gem :
gem install mysql — –with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config