2011-01-31 76 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