Forum: Ruby on Rails Problem installing MySQL driver for OS X Tiger using RubyGem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
untz (Guest)
on 2005-12-01 09:58
(Received via mailing list)
Hello there,

I am experiencing a problem installing the Ruby MySQL driver for OS X
Tiger using RubyGems...

When I tried to install the mysql driver, I received the following
error message:


Raven:~ untz$ sudo su root
Password:
Raven:/Users/untz root# gem install mysql
Attempting local installation of 'mysql'
Local gem file not found: mysql*.gem
Attempting remote installation of 'mysql'
Building native extensions.  This could take a while...
*** 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
         --with-opt-include=${opt-dir}/include
         --with-opt-lib=${opt-dir}/lib
         --with-make-prog=make
         --srcdir=.
         --curdir
         --ruby=/usr/local/bin/ruby
         --with-mysql-config
         --with-mysql-dir=/usr/local
         --with-mysql-include=${mysql-dir}/include
         --with-mysql-lib=${mysql-dir}/lib
         --with-mysqlclientlib=mysqlclient
         --with-mlib=m
         --with-mysqlclientlib=mysqlclient
         --with-zlib=z
         --with-mysqlclientlib=mysqlclient
         --with-socketlib=socket
         --with-mysqlclientlib=mysqlclient
         --with-nsllib=nsl
         --with-mysqlclientlib=mysqlclient
ERROR:  While executing gem ... (RuntimeError)
     ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
   ruby extconf.rb install mysql\nchecking 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... no
checking for mysql_query() in -lmysqlclient... no

BTW, I am using MySQL 5 Community Edition database engine installed
in /usr/local/

Many, many thanks!

-Unnsse
david.felstead (Guest)
on 2005-12-01 10:18
(Received via mailing list)
Try using:

sudo gem install mysql -- --with-mysql-config

Cheers!

-DF
untz786 (Guest)
on 2005-12-01 23:11
(Received via mailing list)
David,

Thanks this worked!

Here's the positive feedback:

make install
mkdir -p /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib
/usr/bin/install -c -m 0755 mysql.bundle /usr/local/lib/ruby/gems/1.8/
gems/mysql-2.7/lib
Successfully installed mysql-2.7

Now, my question is... I am using MySQL 5 Community Edition and would
like to know if this driver (I'm a bit confused since this driver is
version 2.7)
will work with it?

Kindest regards,

Unnsse
david.felstead (Guest)
on 2005-12-02 00:36
(Received via mailing list)
Hi Unnsse - according to the library's webpage:

http://www.tmtm.org/en/mysql/ruby/

It should support MySQL 4.0.22/4.1.13/5.0.11

Good luck!

-DF
This topic is locked and can not be replied to.