我正在尝试mysql2
通过 Bundler 安装 gem,但它一直因以下错误而死:
** executing command
/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in 'rescue in block in build_extensions':
ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb --with-mysql-config=/usr/bin/mysql_config
checking for rb_thread_blocking_region()... 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
--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=/home/cc_rails/.rvm/rubies/ruby-1.9.2-p0/bin/ruby
--with-mysql-config
Gem files will remain installed for inspection.
我通过谷歌搜索找到的大多数东西都建议传递--with-mysql-config
参数来修复它。因此,基于:
$ which mysql_config
/usr/bin/mysql_config
我在 Bundler 的配置中添加了以下内容:
$ bundle config build.mysql2 --with-mysql-config='/usr/bin/mysql_config'
但是,仍然没有运气 - 与上述相同的崩溃。
由于它因错误而死mysql.h is missing
,我检查了它,据说它在附近,只是无法被 Bundler 找到。
$ find / -name mysql.h
/usr/include/mysql5/mysql/mysql.h
有什么想法吗?