2011-01-31 68 views
1

我看到了这个问题的变体,但没有一个是正确的答案(到目前为止)。错误从宝石安装MySQL时10.6

我试图从RubyGems的安装mysql,并得到如下:

Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
    ERROR: Failed to build gem native extension. 

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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. 

Provided configuration options: 
    --with-opt-dir 
    --without-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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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}/lib 
    --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 /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection. 
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out 

我已经尝试了参数,像 - --with-mysql的-配置=在/ usr /本地/ MySQL的/斌/ mysql_config并仍然得到相同的结果。

从MySQL网站手动安装安装,但我无法启动它。

任何想法?

+0

顺便说一句我在轨3 – 2011-01-31 13:13:14

回答

0

它看起来像你已经安装了MySQL,但你没有它的开发标题。您可能需要下载并安装具有这些版本的版本。

我很喜欢使用MacPorts来做这件事,虽然这会给你带来一个稍微不规则的名字,因为MacPorts把它称为mysql_config5。我通常这个符号链接来确定名称:

ln -s /opt/local/bin/mysql_config5 /opt/local/bin/mysql_config 

您可以为任何与像mysql5mysqladmin5与众不同的名字的二进制文件的做到这一点。

+0

我用它的Rails dev(初学者)。愚蠢的问题,这与MacPorts不会有问题吗? – 2011-02-01 01:54:53