Ruby gem mysql fails to install : `require': no such file to load -- mkmf (LoadError)

Recently, I had to upgrade a redmine setup. Amongst other requirements evolutions, which were handled fine by 'aptitude' and 'gem install', I found out I had to manually install a 'mysql' gem, presumably because it was not included any more with one of the dependency shipped with redmine build.

For what is worth, this is rails-related : the mysql connector is no more included, you have to install it separately. The redmine documentation went pretty clear to that point, telling me to run a classic "gem install mysql".


ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)

Erm.

After googling a bit around, I found out I had never installed a gem which had to build native code. Meaning, I neved needed the developpement packages of ruby.

Solution : aptitude install ruby-dev.

Many thanks to http://kenno.wordpress.com/2009/07/25/fixed-extconf-rb8in-require-no-suc... and many other folks who went to this point before.

By the way, migrating from redmine to 0.8.5 to 0.9.3 : this is waaaay much faster. And mod_passenger is waaaay much faster that dispatch.cgi, too. Give it a try !