The bundled mysql.rb driver has been removed from Rails 2.2

Posted on January 23rd, 2009 by Jeff Lin

If you’re getting this error, install the mysql gem by executing the following command:

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

This worked for me, and I’m using Mac OS X 10.5.6, Rails 2.2.2, and MySQL 5.0.67.

14 Comments so far

1 | louis

That doesnt work for me…

I use XAMPP on MacOSX and now i have to install this gem but i always get an error messages. :S

Posted at 4:08 pm on January 27th, 2009
2 | Jeff

@louis, what is the error that you are getting?

Posted at 6:19 pm on January 27th, 2009
3 | louis

Ls-MacBook:~ Ls$ sudo gem install mysql — –with-mysql-config=/Applications/xampp/xamppfiles/bin/mysql_config

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=/Applications/xampp/xamppfiles/bin/mysql_config
checking for mysql_ssl_set()… yes
checking for mysql.h… no
checking for mysql/mysql.h… 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.

Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
–with-opt-lib
–without-opt-lib=${opt-dir}/lib
–with-make-prog
–without-make-prog
–srcdir=.
–curdir
–ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
–with-mysql-config

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

Posted at 8:15 am on January 28th, 2009
4 | Ivan Soto

Same error here… Ubuntu 8.04

Posted at 10:41 am on March 6th, 2009
5 | Olle

Same error here…. GNU/Linux

Posted at 8:08 am on March 16th, 2009
6 | Niyas

I am using Debian and i got the same error..

Posted at 12:03 am on April 30th, 2009
7 | paparao

install libmysql-ruby

Posted at 6:57 pm on October 17th, 2009
8 | elzr

Thanks! This worked perfectly for me.
I had tried different permutations of parameters (sudo gem install mysql — –with-mysql-dir= /usr/local/mysql OR sudo gem install mysql — –with-mysql-include=/usr/local/mysql/include/ –with-mysql-lib=/usr/local/mysql/lib/ –with-mysql config=/usr/local/mysql/bin/mysql_config) but only until I hit on yours did it worked.

I’m on Mac OS 10.6.2, Rails 2.3.4, MySQL 5.1.4

Thanks!

Posted at 2:24 am on November 21st, 2009
9 | benja

thanks elzr.
This works for me:
install libmysql-ruby

Posted at 11:38 am on December 1st, 2009
10 | Carlos Aldas

Same error here… Windows 7 with Netbeans 6.5

help!!!!

Posted at 9:50 am on January 4th, 2010
11 | Max

Hey,

having the same error on OS X 10.6 but when I type “install libmysql-ruby” I am getting:

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 … fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory …

What do I make wrong?

Posted at 11:42 am on January 15th, 2010
12 | joeblogg

Same issue here.

Trying to install netbeans ide 6.8 to work with bitnami ruby stack 2.0-1. Have tried the older libmysql.dll library (from instantrails) and load in the gem – but issue appearing for that version of the dll (2.7.3) as well. Anyone any ideas?
ta.

Posted at 4:59 am on February 6th, 2010
13 | tkdudine

Same error as MAX.
I can not find solutions to install mysql.rb on bitnami redmine 0.9.2 stack

I’m using Mac OSX 10.6.2

Posted at 7:10 am on March 3rd, 2010
14 | Chris

I am having a similar problem on Ubuntu 9.10. When I enter the above I get:

ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb –with-mysql-config=/usr/local/mysql/bin/mysql_config
extconf.rb:10:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:10

Posted at 9:36 pm on March 15th, 2010

Write a new comment


Comment: