# Gem install mysql "checking for mysql\_query() in -lmysqlclie

**URL:** <https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598>\
**Category:** Rails\
**Created:** [April 15, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598 "2009-04-15T16:33:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 15, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598/1 "2009-04-15T16:33:02Z")

</div>

I’ve seen this before but I’ve forgotten how to solve it.

It appears that I have the mysql client libraries installed:

iono@retro[08:25:55][~/] locate libmysqlclient.so

/usr/lib/mysql3/mysql/libmysqlclient.so

/usr/lib/mysql3/mysql/libmysqlclient.so.10

/usr/lib/mysql3/mysql/libmysqlclient.so.10.0.0

/usr/lib/mysql/libmysqlclient.so

/usr/lib/mysql/libmysqlclient.so.14

/usr/lib/mysql/libmysqlclient.so.10

/usr/lib/mysql/libmysqlclient.so.10.0.0

/usr/lib/mysql/libmysqlclient.so.14.0.0

My LD\_LIBRARY\_PATH is:

export  
LD\_LIBRARY\_PATH=/usr/lib/oracle/10.2.0.4/client64/lib:/usr/lib/mysql/

OS:

Linux XYZ 2.6.18-128.1.6.el5 #1 SMP Tue Mar 24 12:05:57 EDT 2009 x86\_64  
x86\_64 x86\_64 GNU/Linux

What gives?

Full “gem install mysql” output follows:

ERROR: Error installing mysql:

```
    ERROR: Failed to build gem native extension.

```

/home/iono/packages/ruby-1.8.7/bin/ruby 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.

Provided configuration options:

```
    --with-opt-dir

    --without-opt-dir

    --with-opt-include

    --without-opt-include=${opt-dir}/include

    --with-opt-lib

    --without-opt-lib=${opt-dir}/lib

    --with-make-prog

    --without-make-prog

    --srcdir=.

    --curdir

    --ruby=/home/iono/packages/ruby-1.8.7/bin/ruby

    --with-mysql-config

    --without-mysql-config

    --with-mysql-dir

    --without-mysql-dir

    --with-mysql-include

    --without-mysql-include=${mysql-dir}/include

    --with-mysql-lib

    --without-mysql-lib=${mysql-dir}/lib

    --with-mysqlclientlib

    --without-mysqlclientlib

    --with-mlib

    --without-mlib

    --with-mysqlclientlib

    --without-mysqlclientlib

    --with-zlib

    --without-zlib

    --with-mysqlclientlib

    --without-mysqlclientlib

    --with-socketlib

    --without-socketlib

    --with-mysqlclientlib

    --without-mysqlclientlib

    --with-nsllib

    --without-nsllib

    --with-mysqlclientlib

    --without-mysqlclientlib

```

Gem files will remain installed in  
/home/iono/packages/gems/gems/mysql-2.7 for inspection.

---

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 15, 2009, 6:39pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598/2 "2009-04-15T18:39:07Z")

</div>

I’ve had this issue before - I’m pretty sure I ended up solving it by  
installing the mysql-devel package first.

On Apr 15, 10:33 am, Rob R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 15, 2009, 5:18pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598/3 "2009-04-15T17:18:35Z")

</div>

> /home/iono/packages/gems/gems/mysql-2.7 for inspection.

Might give some clues.

---

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 15, 2009, 7:10pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598/4 "2009-04-15T19:10:51Z")

</div>

Roger P. wrote:

> > /home/iono/packages/gems/gems/mysql-2.7 for inspection.
> 
> Might give some clues.

Duh.

This is what worked:  
cd /home/iono/packages/gems/gems/mysql-2.7  
ruby extconf.rb --with-mysql-config=/usr/bin/mysql\_config

Thanks for such speedy help!!

R

---

<div class="post-metadata">

**Author:** ![robredford](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@robredford](https://www.ruby-forum.com/u/robredford)\
**Post date:** [April 15, 2009, 7:24pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-checking-for-mysql-query-in-lmysqlclie/165598/5 "2009-04-15T19:24:14Z")

</div>

Rob R. wrote:

> Roger P. wrote:
> 
> > > /home/iono/packages/gems/gems/mysql-2.7 for inspection.
> > 
> > Might give some clues.
> 
> Duh.
> 
> This is what worked:  
> cd /home/iono/packages/gems/gems/mysql-2.7  
> ruby extconf.rb --with-mysql-config=/usr/bin/mysql\_config
> 
> Thanks for such speedy help!!
> 
> R

For completeness, I then did (as per README.html):  
make  
make install

Testing ActiveRecord through mysql now seems to work well.

R
