当我尝试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
当我尝试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
也尝试过但同样的错误。我在Fedora 10上。非常感谢帮助。欢呼!
答案 0 :(得分:9)
在安装MySQL gem之前,您需要安装Ruby和MySQL的Fedora开发包。尝试:
$ sudo yum -y install gcc mysql-devel ruby-devel rubygems
然后重试你的:
$ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
(还要检查/ usr / local / mysql / bin是mysql_config的正确位置,可能是/ usr / bin。)