0

When I try rake db:migrate, I get the following 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! no such file to load -- mysql

And when I try to "gem install mysql"

Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby extconf.rb Can't find header files for ruby. Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.

I checked the rubygems folder and mysql gem has been installed. Any ideas? Cheers

1
  • I'm on Fedora 10 . I tried yum install mysql-devel. But it said that is installed . Commented Apr 8, 2010 at 11:18

3 Answers 3

2

This should sort it out on Ubuntu:

sudo aptitude install libmysqlclient-dev build-essential

Then install the gem again. You may need to delete the /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1 folder if it craps out.

I hope that helps.

Sign up to request clarification or add additional context in comments.

Comments

1

The gem hasn't actually been installed. You are missing either the ruby development files, mysql developer files, or linux build essentials. Since you are asking, I'll assume you are on a linux distribution with a package manager; install the corresponding packages.

Comments

0

As Sleepycat suggested, most probably you need the dev libraries for MySQL.

On Fedora / CentOS this should solve your problem:

yum install mysql-devel
gem install mysql

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.