我正試圖在新的小牛機器上安裝一個不那麼古老(但仍然是幾年)的Rails項目。 當我嘗試bundle
,我不斷收到此錯誤(遺憾的長碼):未能安裝mysql2 gem
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/royzinn/.rbenv/versions/1.8.7-p352/bin/ruby extconf.rb --with-mysql-config=/usr/local/Cellar/mysql/5.5.20/bin/mysql_config
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing. please check your installation of mysql and try again.
-----
*** 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/royzinn/.rbenv/versions/1.8.7-p352/bin/ruby
--with-mysql-config
Gem files will remain installed in /Users/royzinn/dailyd/vendor/ruby/1.8/gems/mysql2-0.2.18 for inspection.
Results logged to /Users/royzinn/dailyd/vendor/ruby/1.8/gems/mysql2-0.2.18/ext/mysql2/gem_make.out
,我有一個消息說,創業板是爲MySQL版本5.5.20搭建起來之前,我已經激活其他(更高級的)MySQL。
我用Homebrew「清理」了所有東西,試圖重新安裝,但似乎沒有任何工作。
任何幫助,高度讚賞。 謝謝!
哦,當我升級到小牛的時候,我遇到了很多問題。 'brew安裝mysql'工作嗎?如果是的話,你可以啓動它? 'mysql.sever重啓'? – Anthony 2014-09-10 18:26:15
該問題與從MySQL連接驅動程序提供頭文件C文件有關。關於這個問題,網絡中也有類似的問題。查看特定操作系統的一個解決方案。我已經在Ubuntu和Windows中處理了這個問題,並且解決方案*基本上是相同的。 – 2014-09-10 19:13:34