On Monday I “upgraded” from Rails 1.2.6 to 2.2.2 (also upgrading to
gem 1.3.1) but in the process have lost the ability to connect with my
mysql database. After finally reinstalling the MySQL gem with the
following gerrymandered command I found on a website (http:// involution.com/category/ruby-on-rails/):
It still doesn’t work! After attempting to access one of my views in
Firefox (3.0.3) I got the following error message:
!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
/!\ FAILSAFE /!\ Wed Jan 07 10:57:23 -0500 2009
Status: 500 Internal Server Error
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9):
no suitable image found. Did find:
/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle: mach-o, but
wrong architecture - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/
mysql.bundle
/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Simply running “gem install mysql” still doesn’t work (hence the hyper
specific command above).
I’m running Mac OS X 10.5.6 on a MacBook with Intel Core 2 Duo.
If anyone has any suggestions I’m all ears. I’ve been locked out of
my rails system for 2 days now and really need to get back to work.
You don’t want to be setting the arch to ppc64 though - you’re on an
intel machine and you’ve just told it to build a gem that will only
work on PowerPC machines! The architecture should be i386
Thanks for pointing that out. Unfortunately, after I went through all
of Dan Benjamin’s directions it still failed to load the mysql gem. I
got the following error message:
sudo gem install mysql – --with-mysql-dir=/usr/local/mysql
Password:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb install mysql – --with-mysql-dir=/usr/
local/mysql
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… 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
*** 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.
Thanks for pointing that out. Unfortunately, after I went through all
of Dan Benjamin’s directions it still failed to load the mysql gem. I
got the following error message:
It should be in /usr/local/mysql/bin/mysql
At least that is what “which mysql” is giving me, although at this
point there may be more than one copy of the software on my machine.
I’m having this EXACT same error and was about to post asking for
help. That last post by Fred fixed it. However, something weird
happened. I have a database called testapp and it says it can’t find
it…I also had 2 mysql_config files on my system.
dlsym(0x2727d10, Init_mysql): symbol not found - /usr/local/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/mysql.bundle
I don’t know why it’s looking for mysql in /usr/local/lib/ruby when I
put it in /usr/local/mysql
It’s not. It’s saying that it couldn’t find a function called
Init_mysql inside the gem. Have you checked whether that mysql.bundle
file is of the correct architecture? (which should match both your
machine and the mysql client libraries you have)
dlsym(0x2727d10, Init_mysql): symbol not found - /usr/local/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/mysql.bundle
I don’t know why it’s looking for mysql in /usr/local/lib/ruby when I
put it in /usr/local/mysql
It’s not. It’s saying that it couldn’t find a function called
Init_mysql inside the gem. Have you checked whether that mysql.bundle
file is of the correct architecture? (which should match both your
machine and the mysql client libraries you have)
/usr/local/bin/ruby extconf.rb install mysql – --with-mysql-dir=/usr/
local/mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
As per the error log its searching for the library lmysqlclient.but its
not availbale.so first install the package libmysqlclient-dev.just check
this blog
Hi, I had to install 32 bit MySQL in order to get Rails running on my
Mac.
If u are a debian user then after typing the below command just press
tab you will find the list of libraries as given below and select the
library suited to ur machine.i have installed libmysqlclient15-dev for
my ubuntu 8.04 64 bit
Hi, I had to install 32 bit MySQL in order to get Rails running on my
Mac.
OS X 10.5.
This worked for me too – if you are real sure that you’ve installed the
gem as suggested elsewhere here, but are still seeing:
dlsym/xxxx Init_mysql): symbol not found
/gems/mysql-2.7/lib/mysql.bundle
move your MySQL to 32 bit install and then re-install the gem with the
– --with-mysql-config=/usr/local/mysql/bin/mysql_config.
The added complication for me was that MySQL 64-bit seems to work with
Ruby 1.8.6 – I only saw problems after updating to 1.8.7.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.