Please help with installing mysql gem to linux machine w/ xampp

Hello all,     I know this is not an uncommon question, but none of the tutorials/tips solve my problem. I've got a linux machine running Ubuntu 10.4 with ruby, gem, rails, and xampp installed.

Now when I try to install the mysql gem (via: $sudo gem install mysql -with-mysql-config=/opt/lampp/bin/mysql_config), I get:

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 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 *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options:   --with-opt-dir   --without-opt-dir   --with-opt-include etc, etc...

What should I check?

Thanks in advance, Dan

Solved! via: http://www.dolicapax.org/?p=11

Hello, check RVM because later you can have more problems http://rvm.beginrescueend.com/gemsets/basics/

I had the same problem, and met with this many times in mailing list. Better to avoid in early stage. Cheers, gezope