0

我已经通过 MAMP 设置了 mysql 服务器。

但是在尝试安装 mysql Rails 客户端(gem install mysql2)时,出现以下错误:

   ERROR: Failed to build gem native extension.
    /Users/krisgandhi/.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.
4

1 回答 1

3

我认为你应该从 MAMP 中删除 mysql。并尝试:

brew install mysql

或者从这里安装,找到合适的 dmg:

http://dev.mysql.com/downloads/mysql/

于 2012-06-08T20:04:56.353 回答