# Gem install mysql error

**URL:** <https://www.ruby-forum.com/t/gem-install-mysql-error/107630>\
**Category:** Rails\
**Created:** [June 24, 2007, 10:53am UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630 "2007-06-24T10:53:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 24, 2007, 10:53am UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630/1 "2007-06-24T10:53:06Z")

</div>

I want to install mysql gem to my debian linux box so when I type:

> > gem install mysql --include-dependencies

I get this error ( I’ve pasted all the installation process)

Select which gem to install for your platform (i486-linux)

1. mysql 2.7.3 (mswin32)
2. mysql 2.7.1 (mswin32)
3. mysql 2.7 (ruby)
4. mysql 2.6 (ruby)
5. Skip this gem
6. Cancel installation

> 3  
> Building native extensions. This could take a while…  
> ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)  
> ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql --include-dependencies  
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  
\*\*\* 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=/usr/bin/ruby1.8  
–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 /var/lib/gems/1.8/gems/mysql-2.7 for  
inspection.  
Results logged to /var/lib/gems/1.8/gems/mysql-2.7/gem\_make.out

How can I install it?

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 24, 2007, 11:08am UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630/2 "2007-06-24T11:08:44Z")

</div>

if you’ve got debian, have you thought about installing mysql via  
synaptic / apt-get ? i think i installed mysql via this rather than a  
gem , but … ?

… what do the results in gem\_make.out say?

…are you installing locally?  
maybe run gem install -r mysql --include-dependencies (maybe the error  
raised is because you don’t have the dependencies locally, but you can  
get em off the net)

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 24, 2007, 11:12am UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630/3 "2007-06-24T11:12:56Z")

</div>

shai wrote:

> if you’ve got debian, have you thought about installing mysql via  
> synaptic / apt-get ? i think i installed mysql via this rather than a  
> gem , but … ?
> 
> … what do the results in gem\_make.out say?
> 
> …are you installing locally?  
> maybe run gem install -r mysql --include-dependencies (maybe the error  
> raised is because you don’t have the dependencies locally, but you can  
> get em off the net)

hello,

I installed mysql already. I want to install mysql driver. doesn’t “gem  
install mysql” installs mysql driver?? I thought it does install the  
driver for mysql not the mysql.

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 24, 2007, 11:39am UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630/4 "2007-06-24T11:39:36Z")

</div>

> I installed mysql already. I want to install mysql driver. doesn’t “gem  
> install mysql” installs mysql driver?? I thought it does install the  
> driver for mysql not the mysql.

mmm. i’ll have to leave this up for the other folks on the forum; i’m  
not really sure 'bout this one.

---

<div class="post-metadata">

**Author:** ![xyzt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/839c29/32.png) [@xyzt](https://www.ruby-forum.com/u/xyzt)\
**Post date:** [June 25, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/gem-install-mysql-error/107630/5 "2007-06-25T14:12:44Z")

</div>

If you have debian you should be able to get by with

sudo apt-get install libmysql-ruby

Otherwise consult the wiki or Google for debian install instructions.  
There  
are several detailed guides out there for this .
