首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在mac上安装mysql2 -错误:安装mysql2时出错:错误:无法构建gem本机扩展

在mac上安装mysql2 -错误:安装mysql2时出错:错误:无法构建gem本机扩展
EN

Stack Overflow用户
提问于 2012-09-08 03:17:18
回答 1查看 273关注 0票数 1

我怎样才能避免这个错误?

代码语言:javascript
复制
$ gem install mysql2  --platform=ruby -v '0.3.11'                                                                                 
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
        ERROR: Failed to build gem native extension.

        /Users/durrantm/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-08 03:18:15

使用brew install mysql修复了此问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12324111

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档