我正在尝试在 Rails 中运行 rake db:migrate,每次尝试时都会遇到相同的错误:
[BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.3.0]
我已经安装了: gcc v4.2.1 ruby 1.9.3p194 rails 3.2.13 XCode 的最新版本(昨晚更新) homebrew 0.9.1 mysql 5.0.96
我整个下午都在搜索 SO 和其他网站,但我只找到了关于 Linux/Debian 的问题的答案。
其他需要注意的事项: mysql gem(和 mysql2)没有安装到我的机器上。尝试安装时,我收到一条消息:
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/USERNAME/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... 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.
有人有想法么!我对 Rails 很陌生,对 ruby 也很陌生,但是这个错误完全阻碍了我的进步。谢谢!