# Mysql gem problem

**URL:** <https://www.ruby-forum.com/t/mysql-gem-problem/187494>\
**Category:** Ruby\
**Created:** [April 24, 2010, 1:07am UTC](https://www.ruby-forum.com/t/mysql-gem-problem/187494 "2010-04-24T01:07:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![osshcs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/7c8e57/32.png) [@osshcs](https://www.ruby-forum.com/u/osshcs)\
**Post date:** [April 24, 2010, 1:07am UTC](https://www.ruby-forum.com/t/mysql-gem-problem/187494/1 "2010-04-24T01:07:12Z")

</div>

Hi

I am a ruby and linux newbie hoping to learn rails. I have Ubuntu 9.10  
(64 bit), ruby 1.8.7, MySQL 5.1.37, which appear sto be working in that  
I can run the Administrator app OK.

When running:  
$ sudo gem install mysql

I get the following:  
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… no  
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.

Most advice seems to centre around locating your mysql\_config file, but  
$ sudo find / -name “mysql\_config” -print  
is drawing a blank.

Can anybody save my head from this brick wall?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![osshcs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/7c8e57/32.png) [@osshcs](https://www.ruby-forum.com/u/osshcs)\
**Post date:** [April 24, 2010, 1:30am UTC](https://www.ruby-forum.com/t/mysql-gem-problem/187494/2 "2010-04-24T01:30:43Z")

</div>

On Fri, Apr 23, 2010 at 5:07 PM, Henry O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Building native extensions. Â This could take a while…  
> checking for mysql\_query() in -lmysqlclient… no  
> $ sudo find / -name “mysql\_config” -print  
> is drawing a blank.
> 
> Can anybody save my head from this brick wall?
> 
> Thanks in advance

Hi, looks like you need the libmysqlclient-dev package from the Ubuntu  
repositories. You may also need the ruby-dev package.

See if that works for you!

-Jonathan N.

---

<div class="post-metadata">

**Author:** ![osshcs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/7c8e57/32.png) [@osshcs](https://www.ruby-forum.com/u/osshcs)\
**Post date:** [April 24, 2010, 2:17am UTC](https://www.ruby-forum.com/t/mysql-gem-problem/187494/3 "2010-04-24T02:17:42Z")

</div>

Jonathan N. wrote:

> Hi, looks like you need the libmysqlclient-dev package from the Ubuntu  
> repositories. You may also need the ruby-dev package.
> 
> See if that works for you!
> 
> -Jonathan N.

That is it solved - thanks. I had the ruby-dev, but not the longer one.
