Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem installing MySQL gem on Fedora [closed]

Tags:

mysql

ruby

gem

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.

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

has also been tried but same error. I'm on a Fedora 10. Help will be much appreciated.Cheers!

like image 965
Shreyas Avatar asked Apr 08 '10 18:04

Shreyas


1 Answers

Before you can install the MySQL gem you need the Fedora development packages for both Ruby and MySQL installed. Try:

$ sudo yum -y install gcc mysql-devel ruby-devel rubygems

and then retry your:

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

(also check that /usr/local/mysql/bin is the correct location for mysql_config, it might be /usr/bin instead.)

like image 200
mikej Avatar answered Oct 19 '22 22:10

mikej