# Problem installing mysql gem

**URL:** <https://www.ruby-forum.com/t/problem-installing-mysql-gem/163296>\
**Category:** Ruby\
**Created:** [March 18, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/problem-installing-mysql-gem/163296 "2009-03-18T23:32:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeymarchy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5fc32e/32.png) [@joeymarchy](https://www.ruby-forum.com/u/joeymarchy)\
**Post date:** [March 18, 2009, 11:32pm UTC](https://www.ruby-forum.com/t/problem-installing-mysql-gem/163296/1 "2009-03-18T23:32:56Z")

</div>

For some reason I can’t get mysql gem installed. I have the  
libmysqlclient  
and mysql-server and mysql-client installed, but it doesn’t work. I am  
running ubuntu 8.10. Am I missing a required package I don’t know about?  
What am I doing wrong?

Here is the output:

joey@lab:~/Projects/rets$ sudo gem install mysql  
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  
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  
\*\*\* 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.

When I try to use the --with-mysqlclientlib conf option, I get this  
output:

joey@lab:~/Projects/rets$ sudo gem install mysql –  
–with-mysqlclientlib  
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 – --with-mysqlclientlib  
checking for mysql\_query() in -ltrue… no  
checking for main() in -lm… yes  
checking for mysql\_query() in -ltrue… no  
checking for main() in -lz… yes  
checking for mysql\_query() in -ltrue… no  
checking for main() in -lsocket… no  
checking for mysql\_query() in -ltrue… no  
checking for main() in -lnsl… yes  
checking for mysql\_query() in -ltrue… 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

see how it changes from -lmysqlclient to -ltrue?
