Install Native MySQL Gem – Edge Rails Stopped Including It

by Justin Ball on July 28th, 2008

I decided to try out the latest edge Rails and I started getting 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.
/!\ FAILSAFE /!\ Mon Jul 28 22:58:38 -0600 2008
Status: 500 Internal Server Error
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

At first I tried:

sudo gem install mysql

which of course didn't work because it never works. You have to tell the complier where to find stuff. Do this:


sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

  • Do you know of a pure Ruby MySQL driver ?
  • supercop
    Hi,
    i try to install
    gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

    but in my local in bin folder i am not find mysql_config

    Thanks
  • Thanks for this. I was about to rip my hair out.
  • Magirus
    Thanks a lot!!

    That took me one error further... ;-)
  • +1 for "it never works"

    Funny, I have been typing the syntax with the path to mysql_config for so long it never occurred to me that the normal syntax might work
blog comments powered by Disqus