[英]mysql gem install fails on snow leopard. My computer is 32bit (mac mini core duo)
我的最終目標是在本地開發Radiant CMS安裝。 因此,需要rails和db才能發揮出色。 以前對mysql的不滿導致我嘗試使用mamp。 我已經安裝了MAMP。 這是工作。 雖然我也開放其他途徑。
試圖安裝mysql gem,但沒有得到愛。
john-breedloves-mac-mini-2:~ john_breedlove$ sudo gem install mysqlPassword:
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:
<Omitted>
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
我已經找到了很多有關在升級到雪豹后安裝gem的建議,但是所有好的答案似乎都指向人們安裝64位版本的mysql。 我有一個32位處理器。
我已經安裝了xcode。
我如何安裝該gem?
您在機器上安裝了mysql嗎?
那是你必須做的第一件事。
那么Mac OS的問題在於它無法在與Linux相同的標准安裝環境下安裝東西。 因此,您必須指定mysql目錄。
使用macports mysql,我可以執行以下操作:
sudo gem install mysql --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
簡而言之,您將需要手動編譯mysql以獲得所需的庫。 到那時,您可能不需要mamp:PI只是手動啟動mysql,並使用dev環境。
http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/
編輯:剛注意到您找到了Hivelogic。 那是要走的路。 編譯后,您無法按照說明將mysql gem指向正確的方向。 另外,我相信讓文檔為gem工作是另一回事,我只是讓它滑下來。
如果您通過自制軟件安裝了mysql,則可以使用以下命令:
sudo gem install mysql -- --with-mysql-include=/usr/local/include/mysql --with-mysql-lib=/usr/local/lib/mysql
添加其他配置參數時,“-”很有用。
使用捆綁器,您應該執行以下操作:
# bundle config build.mysql --with-mysql-config=/usr/local/bin/mysql_config
# bundle install
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.