0

它总是说:

ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

        /Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... *** 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.

如果是 sqlite3,也会发生类似的事情:

ERROR:  Error installing sqlite3:
    ERROR: Failed to build gem native extension.

        /Users/peter/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for sqlite3.h... *** 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.

更新:至少现在正在构建 sqlite3 ... 那是在我rvm remove 1.9.2-p180删除所有 1.9.2 并重新安装之后rvm install 1.9.2,现在 sqlite3 可以捆绑安装,但 mysql2 仍然有问题。

4

1 回答 1

0

我安装了 64 位版本的 MySQL 服务器,它将捆绑安装,然后这个问题帮助了

Library not loaded: libmysqlclient.18.dylib (LoadError)

解决方案:未加载库:尝试使用 mysql2 gem 在 OS X 10.6 上运行“rails server”时出现 libmysqlclient.16.dylib 错误

于 2011-04-03T15:29:13.010 回答