无法在Mac OS 10.9上安装mysql2 [英] can't install mysql2 on Mac OS 10.9

查看:136
本文介绍了无法在Mac OS 10.9上安装mysql2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过

 捆绑安装

  gem install mysql2 

  rvm gem install mysql2 

全部在下面输出。

  rMBP:scripts admin $ rvm gem install mysql2 
请注意``rvm gem ...`已被移除,请尝试`gem install mysql2`或`rvm all gem install mysql2` 。 (请参阅:'rvm用法')
rMBP:脚本admin $ rvm全部执行gem install mysql2
构建本机扩展。这可能需要一段时间...
错误:安装mysql2时出错:
错误:无法构建gem本机扩展。

/Users/admin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
检查rb_thread_blocking_region()...是
检查对于rb_wait_for_single_fd()...是
检查rb_hash_dup()...是
检查rb_intern3()...是
在-lmysqlclient中检查mysql_query()...否
检查main()in -lm ... yes
在-lmysqlclient中检查mysql_query()... no
检查main()in -lz ... yes
在-lmysqlclient中检查mysql_query()... no
在-lsocket中检查main()... no
在-lmysqlclient中检查mysql_query()... no
检查-lnsl中的main()... no
在-lmysqlclient中检查mysql_query()... no
在-lmygcc中检查main()... no
检查mysql_query()in -lmysqlclient ... no
*** extconf.rb失败***
由于某些原因无法创建Makefile,可能缺少必要的
库和/或头文件。检查mkmf.log文件以获取更多详细信息。您可能
需要配置选项。

提供的配置选项:
--with-opt-dir
--with-opt-include
--without-opt-include = $ {opt- dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
--without-make-prog
--srcdir =。
--curdir
--ruby = / Users / admin / .rvm / rubies / ruby​​-2.0.0 -p247 / bin / ruby​​
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql -include = $ {mysql-dir} / include
--with-mysql-lib
--without-mysql-lib = $ {mysql-dir} /
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
- -with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
- without-mysqlclientlib
--with-mygcclib
--without-mygcclib
--with-mysqlclientlib
--without-mysqlclientlib


Gem文件将保留安装在/Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13中进行检查。
结果记录到/Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13/ext/mysql2/gem_make.out
rMBP:scripts admin $

我有Xcode 5 DP3和Maverick 10.9最新测试版(13A510d)

Xcode 5具有内置于应用程序中的命令行工具(位于应用程序包内) ,您需要安装MySql,并使用HomeBrew

  brew install mysql 

如果您使用10.9 DP-3,则可能会失败。但是,我通过将SystemVersion.plist中的productVersion更改为10.8来欺骗,位于/ System / Library / CoreServices中,然后你就可以安装mysql了。
$ b $继续安装mysql2

pre $ code> gem install mysql2

安装完所有东西后,您必须将productVersion更改回10.9。


I've tried

bundle install

and

gem install mysql2

and

rvm gem install mysql2

all have the same output below.

rMBP:scripts admin$ rvm gem install mysql2
Please note that `rvm gem ...` was removed, try `gem install mysql2` or `rvm all do gem install mysql2` instead. ( see: 'rvm usage' )
rMBP:scripts admin$ rvm all do gem install mysql2
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

    /Users/admin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... 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
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/admin/.rvm/rubies/ruby-2.0.0-p247/bin/ruby
    --with-mysql-config
    --without-mysql-config
    --with-mysql-dir
    --without-mysql-dir
    --with-mysql-include
    --without-mysql-include=${mysql-dir}/include
    --with-mysql-lib
    --without-mysql-lib=${mysql-dir}/
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mlib
    --without-mlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-zlib
    --without-zlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-socketlib
    --without-socketlib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-nsllib
    --without-nsllib
    --with-mysqlclientlib
    --without-mysqlclientlib
    --with-mygcclib
    --without-mygcclib
    --with-mysqlclientlib
    --without-mysqlclientlib


Gem files will remain installed in /Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13 for inspection.
Results logged to /Users/admin/.rvm/gems/ruby-2.0.0-p247/gems/mysql2-0.3.13/ext/mysql2/gem_make.out
rMBP:scripts admin$ 

I have Xcode 5 DP3 and Maverick 10.9 latest beta (13A510d)

Xcode 5 has the command line tools built in to the app (inside the app package)

解决方案

First , you need to install MySql,and I use HomeBrew

brew install mysql

if you use 10.9 DP-3 ,you may fail.But I cheat by changing productVersion to 10.8 in SystemVersion.plist located in /System/Library/CoreServices,and then you can install mysql.

Continue to install mysql2

gem install mysql2

After you have install all stuff,you must change productVersion back to 10.9.

这篇关于无法在Mac OS 10.9上安装mysql2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆