mysql - gem安装mysql2 windows native 扩展等问题

标签 mysql ruby rubygems

我浏览过很多网站,但没有一个对其他人有效的网站似乎对我也有效。

 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 是正确的下载。我尝试添加连接器,但没有任何作用。通过类进行逐步安装,所以我知道我正在按正确的顺序执行操作,但没有任何方法可以帮助解决此错误。

最佳答案

这实际上看起来像是 extconf.rb:37 上的错误,而不是缺少依赖项或某些编译问题。

假设您三次检查您的 ruby​​ 版本是否受此版本的 gem 支持,并且您使用的是您的 ruby​​ 版本支持的最新版本,我建议 open an issue on github .

关于mysql - gem安装mysql2 windows native 扩展等问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18665502/

相关文章:

MySQL:像这样创建数据库?

php - 从特定日期开始按 7 天间隔对行进行分组

python - 如何使用python从数据库MySQL中获取行?

ruby-on-rails - 在 Ubuntu Server 12.04 上安装 Ruby gem "ffi"时出现问题

ruby - 开发Ruby gem时如何添加 "pry"

php - 无效查询 - 更新 MySQL 数据库时出现问题

ruby - 如何查看对象类中的所有方法/属性

python - XCode 3.2 Ruby 和 Python 模板

ruby - 降级 gem 时,bundler 是否可以自动降级 gem 的依赖项?

ruby-on-rails - 不了解 Bundler 与 Gems 的交互