对于 Ruby on Rails,如何“gem install mysql2”从 Leopard 升级到 Snow Leopard 后?

发布于 2024-10-29 20:55:56 字数 1051 浏览 0 评论 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删除1.9.2-p180并删除之后所有1.9.2,并通过rvm install 1.9.2重新安装,现在sqlite3可以捆绑安装,但mysql2仍然有问题。

It always says:

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.

similar things happen if it is 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.

Update: at least sqlite3 is building now... that is after I rvm remove 1.9.2-p180 and removing all the 1.9.2, and reinstall by rvm install 1.9.2 and now sqlite3 can be bundle installed, but mysql2 still has problem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

-柠檬树下少年和吉他 2024-11-05 20:55:56

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

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

问题: 未加载库:尝试使用 mysql2 gem 在 OS X 10.6 上运行“rails 服务器”时出现 libmysqlclient.16.dylib 错误

I installed the 64 bit version of MySQL server and it will bundle install, and then this question helped with the

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

solution: Library not loaded: libmysqlclient.16.dylib error when trying to run 'rails server' on OS X 10.6 with mysql2 gem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文