Ruby gem mysql2安装错误
发布时间:2020-12-16 19:56:47 所属栏目:百科 来源:网络整理
导读:我在 Windows7中安装了 Ruby版本的ruby 1.9.2p0(2010-08-18)[i386-mingw32]. 和宝石血统1.3.7 当我试图安装mysql gem时,显示无法构建gem本机扩展错误,为什么会这样?我的mysql版本是5.1.36(WampServer) E:RubyAppstest_app2gem install mysql2Building nat
我在
Windows7中安装了
Ruby版本的ruby 1.9.2p0(2010-08-18)[i386-mingw32].
和宝石血统1.3.7 当我试图安装mysql gem时,显示无法构建gem本机扩展错误,为什么会这样?我的mysql版本是5.1.36(WampServer) E:RubyAppstest_app2>gem install mysql2 Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. E:/Ruby192/bin/ruby.exe extconf.rb checking for rb_thread_blocking_region()... *** 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=E:/Ruby192/bin/ruby E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to genera te an executable file. (RuntimeError) You have to install development tools first. from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:440:in `try_link' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:552:in `try_func' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:797:in `block in have_func' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postp one' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' from E:/Ruby192/lib/ruby/1.9.1/mkmf.rb:796:in `have_func' from extconf.rb:9:in `<main>' Gem files will remain installed in E:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0. 2.3 for inspection. Results logged to E:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.2.3/ext/mysql2/ge m_make.out E:RubyAppstest_app2> 解决方法
由于这不断在谷歌上出现在顶级的结果,我应该指出,这个答案是从近两年前.这是一个更新的答案:
How to use “mysql2” gem in Rails 3 application on Windows 7?
根据开发人员的说法,已经有一个报告的错误,他正在努力将mysql2分配到Windows.到目前为止 – 它仍然在作品中.现在使用较旧的mysql驱动程序 – 或者使用sqlite进行本地开发. 这是从googlegroups讨论
|