所以我知道這個問題已經被問過了,而且我查看了所有以前的答案,但仍然找不到解決方案。希望你們都能幫忙。MySQL Ruby Gem安裝問題
設置:我正在運行Mac OS X 10.6服務器。我已經使用內置的MySQL安裝在網絡應用程序,它很好。現在我正在嘗試運行需要MySQL的RoR應用程序。
所以,每當我進入
gem install mysql
它吐出回以下錯誤:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/Users/admin/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-mysql-config=/var/mysql
*** 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=/Users/admin/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
--with-mysql-config
extconf.rb:35:in ``': Permission denied - /var/mysql --cflags (Errno::EACCES)
from extconf.rb:35:in `<main>'
Gem files will remain installed in /Users/admin/.rvm/gems/[email protected]/gems/mysql-2.8.1 for inspection.
Results logged to /Users/admin/.rvm/gems/[email protected]/gems/mysql- 2.8.1/ext/mysql_api/gem_make.out
所以,通過我的研究,我想具體說明了MySQL的安裝位置。
gem install mysql -- --with-mysql-config=/var/mysql
不幸的是,結果也一樣。
任何想從哪裏去這裏?
謝謝!
凱文
有沒有使用mysql2理由嗎? – 2011-04-09 19:30:52
http:// stackoverflow。com/questions/2167598/mysql-install-error-failed-to-build-gem-native-extension – fl00r 2011-04-09 20:06:09
http://stackoverflow.com/questions/354194/mysql-installation-troubles – fl00r 2011-04-09 20:06:29