所以我知道这个问题已经被问过了,而且我查看了所有以前的答案,但仍然找不到解决方案。希望你们都能帮忙。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