【问题标题】:unable to install mysql-2.9.1.gem in windows 8.1 with ruby version 2.1.5无法在带有 ruby​​ 版本 2.1.5 的 Windows 8.1 中安装 mysql-2.9.1.gem
【发布时间】:2015-03-31 09:25:59
【问题描述】:

我使用的是 Ruby 2.1.5,其余细节是

* 本地宝石 *

大十进制 (1.2.4) io 控制台 (0.4.2) json (1.8.1) 迷你测试(4.7.5) mysql (2.8.1 x86-mingw32) 心理 (2.0.5) 耙子 (10.1.0) rdoc (4.1.0) 测试单元 (2.1.5.0)

当我安装 mysql-2.9.1.gem 时出现如下错误::

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 ruby-on-rails ruby rubygems


    【解决方案1】:

    我在安装 mysql gem 时也遇到了这个问题。也许this 可以提供帮助。

    【讨论】:

    • Ruby Gems 无法在 64 位版本上正常工作,因此您可以安装 32 位版本并且它可以正常工作..,刚刚我已修复..,
    • 我实际上安装了一个64位版本,它工作正常
    猜你喜欢
    • 2015-03-24
    • 2021-11-13
    • 1970-01-01
    • 2010-12-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-14
    • 1970-01-01
    相关资源
    最近更新 更多