MySQL extension for Ruby on Ubuntu 9.04 ※
※
Jul 30
If you try to install MySQL library for Ruby using standard "gem install mysql" command you will get an error like this:
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 install mysql
extconf.rb:1:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:1
There might be a problem with default Ubuntu dependencies for Ruby package.
Follow three steps to install MySQL extensions for Ruby.
1. Install Ruby development files:
$ sudo apt-get install ruby1.8-dev
2. Install required MySQL development files:
$ sudo apt-get install libmysqlclient15-dev
3. And now you can install MySQL extension:
$ sudo gem1.8 install mysql
That's it!