Gem install mysql error

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?

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)

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.

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.

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 .