【发布时间】:2013-10-01 14:06:45
【问题描述】:
我正在尝试在 Windows 7 上安装 mysql2 gem 我从 mysql 站点下载了连接器并将 libmysql.dll 放在 ruby200\bin 中
然后做 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/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/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/lib/ruby/gems/2.0.0/gems/mysql2-0.
3.13 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/ext/mysql2/g
em_make.out
【问题讨论】:
-
如其所示,查看:结果记录到 C:/Ruby200/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/ext/mysql2/g em_make.out 和还 mkmf.log 用于描述性错误。把它们贴在这里。它可能需要诸如提供“gem install mysql2 --with-MySQL-lib=
”之类的标头。可以下载这些文件以允许安装,但请确保它与您的 gem 的 mod 级别匹配。我在包括 MySQL 的 Windows 8 上使用 BitNami Rubystack。 RailsInstaller 是一个非常流行的综合安装。 -
可能是原生安装gem的问题。你能安装其他像 bson_ext 这样的原生 gem 吗?
-
是的,谢谢你们的帮助,@R_G 是的,我需要通过下面的 gem 命令指定每个所需文件的位置,这就是为什么 gem install 看起来不一样文件夹我不确定,我试图远离捆绑安装程序,因为它可以帮助我更好地理解 Rails!
-
阅读我的问题顶部的黄色文本。这就是 mysql gem 和 mysql2 gem 无法安装的原因! stackoverflow.com/questions/30361280/…