Forum: Ruby on Rails [mysql gem] Failed to lookup Init function

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.
473573dbec97a074cf0edd7635cdcdef?d=identicon&s=25 tejo (Guest)
on 2008-10-24 22:06
(Received via mailing list)
Hi, with mysql.rb removed from rails 2.2 I need to install the mysql

I have mac osx 10.5.5

I have mysql installed in /usr/local/mysql, so, after a bunch of try,
I've installed
the gem with:

env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/

the gem seems installed in /usr/local/lib/ruby/gems/1.8/gems/

but when I try to fire up a command than involves mysql e.g.: rake
db:create I get this error:

LoadError: Failed to lookup Init function /usr/local/lib/ruby/gems/1.8/
from /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle

I also tried with:

env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-include=/
usr/local/mysql/include --with-mysql-lib=/usr/local/mysql/lib --with-
mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/mysql/bin/

and many other ways, but still get the same error.

Any ideas?

473573dbec97a074cf0edd7635cdcdef?d=identicon&s=25 tejo (Guest)
on 2008-10-25 15:37
(Received via mailing list)

After a load of pain and suffer i solved Installing mysql5 client from

sudo port install mysql5

and re-installing the mysql gem with this options:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-
include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/
mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

Hope this can help somebody to save some hours of googoling.
This topic is locked and can not be replied to.