Re-installed OSX yesterday and with it, Ruby and Rails
Now when I try to run db:migrate I get the 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.
Rake aborted!
no such file to load – mysql"
So, I try sudo gem install mysql – --with-mysql-dir=/usr/local/mysql
And get:
##########
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.
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/
mysql-2.7 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/
gem_make.out
Yea - installed MYSQL from the package and it is running in the system
preferences pane- basically followed the steps on dan benjamins
tutorial on installing rails on OSX tiger.
@Eric - tried the command in terminal - just got the same error.
I’m encountering similar errors and difficulties. When I enter:
sudo env ARCHFLAGS="-arch i386" gem install mysql –
–with-mysql-config=/usr /local/mysql/bin/mysql_config
as many have suggested, I still get the same “can’t find header files
for ruby” error message:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config
can’t find header files for ruby.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7
for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out
Yea - installed MYSQL from the package and it is running in the system
preferences pane- basically followed the steps on dan benjamins
tutorial on installing rails on OSX tiger.
@Eric - tried the command in terminal - just got the same error.
Any suggestions guys?
using the --with-mysql-config option usually works for me (pass it
the location of the mysql_config thing). Also make sure you have the
32 bit version of mysql, not 64 bit.
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7
for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out
Any suggestions for diagnosing my mistake here?
That sounds like a different issue ( in Gavin’s case it just the
headers/libs for mysql it can’t locate) - maybe you don’t have all of
the stuff from the Dev tools you need ?
However, when I try to run rake db:migrate or make a db query I get
this error:
!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
rake aborted!
dlsym(0x103290, Init_mysql): symbol not found - /usr/local/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/mysql.bundle