Lars Pind

internet software, coaching, and entrepreneurship

Lars Pind - internet software, coaching, and entrepreneurship
Check out Coach TV, my video blog on happiness and personal development for geeks.

Compiling the Native MySQL Ruby Gem on Debian

October 05, 2006 · 2 comments

I just realized that my production servers were running the Ruby version of the MySQL driver, to the tune of a performance penalty of 10-15%, according to Riding Rails.

It turns out the compilation had failed because it couldn’t locate the include files and library files, which get strewn around the file system in Debian when MySQL in installed using “apt”.

After trying various things, it turns out this worked:

sudo gem install mysql -- --with-mysql-config

Don’t ask me why, it just worked for me. I’d suppose that compiling your own Mysql and installing it /usr/local would work as well, if you use thi—with-mysql-dir option instead.

blog comments powered by Disqus

2 responses so far ↓

  • 1 Jos Hartman // Nov 09, 2006 at 10:54 PM

    Magic !! I had troubles to install mysql on Host Europe which is some SuSE distro and this worked !!!!
  • 2 Olle Jonsson // Nov 24, 2006 at 08:59 AM

    My trouble was solved (without having to give any options to gem install) when I installed the "library header files":http://packages.ubuntulinux.org/dapper/libdevel/libmysqlclient15-dev as well. D'oh! Thanks for bringing this up.