No such file to load -- mysql

Hello all,

This seems to be a regular problem. But I couldn’t find a solution
that worked for me. I am getting the following error when I do rake
db:create:

!!! 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

My first action was to install mysql. I did that with:

sudo gem install mysql – --with-mysql-config=which mysql_config

but that didn’t solve the issue. Then I tried the following:

sudo env ARCHFLAGS=“-arch i386” gem install -V mysql – --with-mysql-
config=which mysql_config

sudo env ARCHFLAGS=“-arch i686” gem install -V mysql – --with-mysql-
config=which mysql_config

Even they don’t solve the issue even though all 3 of the above
installed mysql properly. My ‘gem list’ shows:
mysql (2.7.3, 2.7)

which means I have mysql installed. (or am I wrong?)

There is a workaround here (posts 2 & 3):
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/036bd945212418ff/eafebb2d42035822?lnk=raot

but they suggest tweaking the ruby mysql version. I plan to use mysql
in production. So I want to install the C version of mysql.

There is another solution here:

but it’s a window solution (they provide a DLL file).

Any help?

-subbu

Install libdbd-mysql-ruby1.8

On Sat, Feb 7, 2009 at 3:22 PM, Subbu [email protected]
wrote:

no such file to load – mysql
sudo env ARCHFLAGS=“-arch i686” gem install -V mysql – --with-mysql-
http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/036bd945212418ff/eafebb2d42035822?lnk=raot
-subbu


Johalf Farina
fande.elance.com
www.fande.com.br
http://twitter.com/johalf
http://www.linkedin.com/in/johalf
Phone +55 51 81146026

What OS are u on?
On linux, (I read from Johalf’s email), you need to install libmysql-
ruby1.8 package. This is not a ruby gem but a ubuntu .deb or
redhad .rpm package.
On Cygwin+windows, you need to build mysql from source, which may take

There is no gem with this name. I installed dbd-mysql-0.4.2 but still
doesn’t work.

Sorry is this libmysql-ruby1.8

On Sat, Feb 7, 2009 at 3:40 PM, Johalf Farina
[email protected]wrote:

db:create:
but that didn’t solve the issue. Then I tried the following:

Johalf Farina
fande.elance.com
www.fande.com.br
http://twitter.com/johalf
http://www.linkedin.com/in/johalf
Phone +55 51 81146026


Johalf Farina
fande.elance.com
www.fande.com.br
http://twitter.com/johalf
http://www.linkedin.com/in/johalf
Phone +55 51 81146026

Here is the other workaround link. Missed in the first post:
http://forums.aptana.com/viewtopic.php?f=20&t=7563

I am on Mac OSX 10.4

Hello!
I’ve got same problem! Can’t continue working with Rails!
I have OSX 10.5.6. Mysql 5.0.67, Latest Ruby , Rubygems, Rails 2.2.2,
and mysl gem 2.7 installed in this way
sudo env ARCHFLAGS="-arch i386" gem install mysql – --with-mysql-
dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-
mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/
mysql/bin/mysql_config

when I do rake db:migrate

!! 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

I’ve been googling for 3 days and none of the solutions work for me.
I’ve reinstalled mysql ,ruby and rails several times… got same
error. Please help!
Thanks beforehand

I have same problem. I’ve installed MySQL 5.0.67. Rails 2.2.2.
RubyGems and especially this mysql gem 2.7 (# sudo env ARCHFLAGS="-
arch i386" gem install mysql – --with-mysql-config=/usr/local/mysql/
bin/mysql_config) I’m on MacOS 10.5.6.
When I do rake db:migrate:
!!! 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

Have been Googling for 2 days - none of the solutions work.
Reinstalled Ruby Gems and Rails twice already - same error.
Please assist me. Thanks beforehand!

Adding to the list of stuck people. I’m on Ubuntu 9.10.

庄杰 wrote:

install mysqlå•Š

Installing mysql doesn’t fix it. That’s the problem. I’ve attached the
output from installing mysql, in case there’s a clue there.

thanks,

-nate

install mysqlå•Š