Compiling the Native MySQL Ruby Gem on Debian
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.