Forum: Ruby on Rails Symbol lookup error in mysql gem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7b74ccf93dde7dd2ac5d2980d14fdc7b?d=identicon&s=25 Paul Lynch (plynchnlm)
on 2007-04-13 00:27
(Received via mailing list)
I've been having a problem where the rails server (either WEBrick or
Mongrel) hangs and becomes unresponsive overnight.  I read some posts
that caused me to think this might be an issue with Ruby's MySQL
driver, so I thought I would try the mysql gem.  I ran:

gem install mysql --include-dependencies -- --build-options --with-

picked "mysql 2.7 (ruby)" (because I'm running on RedHat Linux) and
got a message that the gem had successfully been installed.

However, as soon as my application tries to access the database, I get
the following error (and Mongrel crashes):

ruby: symbol lookup error: /depot/packages/ruby-1.8.5-p2-bin/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/ undefined symbol:

Does anyone have any idea what might be the cause?  It seems odd that
something would compile successfully, but then crash when running.  I
get the same error if I try to access the database from script/

Dfd6f9989147955682701da8227df8b4?d=identicon&s=25 Michael Wang (Guest)
on 2007-04-13 05:59
(Received via mailing list)
Paul E. G. Lynch wrote:
> console.
You have a version of MySQL compiled with the Intel compiler and the
Ruby MySQL library hasn't been linked against the additional Intel
libraries. Here's an example of how to fix this in Perl DBD::mysql:

It might give you some ideas on how to fix it with Ruby.

Michael Wang
7b74ccf93dde7dd2ac5d2980d14fdc7b?d=identicon&s=25 Paul Lynch (plynchnlm)
on 2007-04-23 19:23
(Received via mailing list)
Thanks-- this helped me to get the C-based mysql driver compiled and
working.  Also, it appears that the installation of this gem made the
overnight-hang problem go away (though I have only had it running for
about 36 hrs, so it is maybe a little early to be sure).  In case
anyone is having the same problem in getting the C-based mysql driver
to work, here are the steps I took:

1) Install the mysql gem, e.g.:
   gem install mysql --include-dependencies -- --build-options --with-

2) Download the Intel CC libraries that were used to compile MySQL
(There is probably another page to use if you aren't working on a
Linux machine).  You have to pick the libraries corresponding to your
machine's architecture, and also need to pick a version number (for
which I used the latest and hoped for the best.)  I unpacked these

3)  Manually edit the mysql gem Makefile.  This file is actually
generated during the installation, so this is not an ideal solution,
but I couldn't find a better one.  The Makefile is in the top-level
directory of the installed mysql gem, e.g.:
The change you need to make is to the LIBS variable in the makefile.
You have to add a -L option to specify the location of the downloaded
libraries, and then you need to add a -l option for the "irc"
library.  (I got this from the perl post Michael references;
otherwise, it would have taken a lot of trial and error.)  Here's what
my LIBS line looks like:

LIBS =  -L/depot/packages/mysql/lib -L/depot/packages/intel-icc9-
libs-9.0-i386 -lmysqlclient -lirc -lz -lcrypt -lnsl -lm  -ldl -lcrypt -
lm   -lc

4) Run make and then "make install".

5) Restart the web server (e.g. Mongrel).
This topic is locked and can not be replied to.