MySQL extension for Ruby on Ubuntu 9.04ArnasJul 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!

Daylight blog

Read more →

Featured links

What clients say

"Passionate, determined, and caring. Deliver excellent quality of work. Great Partners."

Eglė Karalytė
InfinVision

Contact us

Let's discuss your business ideas and wishes together.

Email hello@idiles.com
Phone +370 612 60488
+370 5 2357131