我已經瀏覽了stackoverflow上的多個問題,他們都給出了不同的解決方案。我git克隆了一個rails項目,運行了bundle install,並在rvm中使用1.9.3 ruby創建了一個新的gemset,並且使用bundle install命令也可以安裝3.2.13。在過去,我通過使用本指南解決了這個問題,http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html。我無法在用戶/本地找到mysql文件夾,指南說我需要編輯一個文件,並刪除一些行來解決mysql.h缺失的問題。該文件不再存在?我找不到它?也許我缺少依賴關係,但我發現這些依賴關係的Linux安裝方式?也許我需要安裝mysql5.5而不是最新版本,但不知道如何指定?這其中的一個將爲我解決這個問題?MySQL軟件包安裝
Installing mysql2 (0.3.11)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
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
--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/judyngai/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
--with-mysql-config
--without-mysql-config
Gem files will remain installed in /Users/judyngai/.rvm/gems/[email protected] /gems/mysql2-0.3.11 for inspection.
Results logged to /Users/judyngai/.rvm/gems/[email protected]/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
An error occurred while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
mac osx 10.8.4,我還沒有看到答案。現在會做 – Jngai1297
是的我知道了,原來指導是正確的,但我錯誤的路徑到mysql_config文件,感謝您的幫助 – Jngai1297