Installing the mysql Ruby gem

While trying to install this gem on Ubuntu 8.04.3 (Hardy) to run a rails app (Redmine), I encountered the following error:

$ sudo gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
        from extconf.rb:1

There are a bunch of common errors when installing the mysql gem, so Googling for the solution wasn’t instant. Luckily I found this post which showed the missing package: ruby1.8-dev.

Solution

sudo apt-get install ruby1.8-dev

and the MySQL gem installed fine.

Share and Enjoy:
  • Reddit
  • Digg
  • Twitter
  • Slashdot
  • StumbleUpon
  • Google Bookmarks
  • Facebook
  • E-mail this story to a friend!
  • Print this article!
Posted on Saturday, August 1st, 2009 at 1:18 pm and is filed under System administration. 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

Name (*)
Mail (will not be published) (*)
URI
Comment