无法在ruby版本为2.1.5的windows 8.1中安装mysql-2.9.1.gem
我使用的是Ruby 2.1.5,其余细节如下 *本地宝石* bigdecimal 1.2.4 io控制台0.4.2 json 1.8.1 小型试验4.7.5 mysql 2.8.1 x86-mingw32 心理学2.0.5 rake 10.1.0 RDOC4.1.0 测试单元2.1.5.0 当我安装mysql-2.9.1.gem时,它给出了如下错误:无法在ruby版本为2.1.5的windows 8.1中安装mysql-2.9.1.gem,mysql,ruby-on-rails,ruby,rubygems,Mysql,Ruby On Rails,Ruby,Rubygems,我使用的是Ruby 2.1.5,其余细节如下 *本地宝石* bigdecimal 1.2.4 io控制台0.4.2 json 1.8.1 小型试验4.7.5 mysql 2.8.1 x86-mingw32 心理学2.0.5 rake 10.1.0 RDOC4.1.0 测试单元2.1.5.0 当我安装mysql-2.9.1.gem时,它给出了如下错误: Building native extensions. This could take a while... ERROR: Error ins
Building native extensions. This could take a while...
ERROR: Error installing mysql-2.9.1.gem:
ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for main() in -llibmysql... *** 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:/Ruby21-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}/lib
--with-libmysqllib
--without-libmysqllib
C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to gen
erate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in po
stpone'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from C:/Ruby21-x64/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
from extconf.rb:27:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/mysql-
2.9.1 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0
/mysql-2.9.1/gem_make.out
D:\Softwares>
我在安装mysql gem时也遇到了这个问题。可能会有帮助。Ruby Gems无法在64位版本下正常工作,因此您可以安装32位版本,并且工作正常..,刚才我修复了..,我实际安装了64位版本,并且工作正常