0

我仔细阅读了许多网站,但对其他人有用的东西似乎对我有用。

 C:/Users/Holly/Desktop/Brolie>gem install mysql2 Temporarily enhancing
 PATH to include DevKit... Building native extensions.  This could take
 a while... ERROR:  Error installing mysql2:
         ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... yes checking for
 rb_wait_for_single_fd()... yes checking for rb_hash_dup()... yes
 checking for rb_intern3()... yes
 *** 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=C:/Ruby200-x64/bin/ruby
         --with-mysql-dir
         --without-mysql-dir
         --with-mysql-include
         --without-mysql-include=${mysql-dir}/include
         --with-mysql-lib
         --without-mysql-lib=${mysql-dir}/ extconf.rb:37:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError )


 Gem files will remain installed in
 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql 2-0.3.13 for inspection.
 Results logged to
 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/ext/mysq
 l2/gem_make.out

我的 DevKit 是正确的下载。我试过添加连接器,但没有做任何事情。通过课程逐步安装,所以我知道我正在以正确的顺序做事,但没有什么能帮助这个错误。

4

1 回答 1

0

这实际上似乎是一个错误,extconf.rb:37而不是缺少依赖项或某些编译问题。

假设您三次检查此版本的 gem 是否支持您的 ruby​​ 版本,并且您使用的是 ruby​​ 版本支持的最新版本,我建议在 github 上打开一个问题

于 2013-09-06T23:32:08.750 回答