[英]mysql gem install error in rails
我剛剛負責一個新的應用程序,一個已經構建的應用程序,為它添加新功能等。 不幸的是,它是幾年前構建的(使用 rails 2.1)並使用 mysql(我更喜歡 postgres)。 我正在嘗試安裝 mysql gem,這樣我就可以在本地機器上弄亂代碼,但出現以下錯誤。
$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Password:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/opt/local/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
checking for mysql_ssl_set()... no
checking for rb_str_set_len()... no
checking for rb_thread_start_timer()... no
checking for mysql.h... no
checking for mysql/mysql.h... 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
--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=/opt/local/bin/ruby
--with-mysql-config
Gem files will remain installed in /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /opt/local/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
我檢查了目錄 /usr/local/mysql/bin/mysql_config 以確保該文件存在(確實存在)...我使用來自 mysql 站點的 dmg 文件(v 5.1)安裝了 mysql。
坦率地說,我不知道如何解決這個問題。 有什么建議么?
謝謝!
我認為 dmg 文件中不包含 mysql header 文件。 安裝 Homebrew 或 Macports 並運行brew install mysql
或sudo port -v install mysql5-server mysql5
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.