Mysql – Ruby EE ./installer fails on thesql gem installation

MySQLruby-enterprise-edition

So, installing Ruby Enterprise Edition went fairly smoothly (except for a very odd quirk of the system I'm on, where I had to apt-get install build-essentials because there was no GCC…), but it failed to install any of the database gems properly. I mainly want to use MySQL. Here's the output of Ruby EE's ./installer during the mysql gem installation:

Installing mysql...
/opt/ruby-enterprise-1.8.6-20090610/bin/ruby /opt/ruby-enterprise-1.8.6-20090610/bin/gem install -r --no-rdoc --no-ri --no-update-sources --backtrace mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/opt/ruby-enterprise-1.8.6-20090610/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***

Apparently my server's MySQL installation didn't come with source, so I can't just recompile and hope it works… I tried to download the version and compile that, but I'm not sure what to do from here. Any ideas? MySQL is already running on this server with quite a few databases, so I'd also rather not mess with what's already here…

Best Answer

After a fair bit of struggle, I started browsing through aptitude hoping to find a package that might solve the problem. I found libmysqlclient-dev, installed it, and rebuilt the gem... and it worked. I feel pretty stupid, heh, but this is only my first time trying to deploy a Rails app to a real webserver.