argghhh….

This error wasted a lot of my time … and it was just as simple as abc :(

after some googling I found the solution for the error below which appears while installing the gem mysql on a fresh ubuntu box.

$ 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:10:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:10

Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

The solution to this error was: just install the development package – which is part of the ruby1.8-dev.

So simple

sudo apt-get install ruby1.8-dev

Building native extensions.  This could take a while…
Successfully installed mysql-2.8.1
1 gem installed

Installing ri documentation for mysql-2.8.1…

and then install the gem as

sudo gem install mysql