【问题标题】:error in `install bundler` while installing ruby gems on windows machine在 Windows 机器上安装 ruby​​ gems 时出现“安装捆绑器”错误
【发布时间】:2014-08-14 08:41:09
【问题描述】:

我正在尝试安装中间人 - 一个使用 ruby​​ gem 的静态站点生成器。它能够构建所有本机扩展,但不能构建 wdm。当我在命令提示符下运行 install bundler 命令时,我收到以下错误消息。

                 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

                C:/Ruby200/bin/ruby.exe -r ./siteconf20140814-4200-t0fvuf.rb extconf.rb
            checking for main() in -lkernel32... *** 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-kernel32lib
                    --without-kernel32lib
            C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to genera
            te an executable file. (RuntimeError)
            You have to install development tools first.
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:519:in `try_link0'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:720:in `try_func'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:950:in `block in have_library'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postp
            one'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:310:in `open'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
                    from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:945:in `have_library'
                    from extconf.rb:19:in `<main>'

            extconf failed, exit code 1

            Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/wdm-0.1.0
             for inspection.
            Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/wd
            m-0.1.0/gem_make.out
            An error occurred while installing wdm (0.1.0), and Bundler cannot continue.
            Make sure that `gem install wdm -v '0.1.0'` succeeds before bundling.

在运行之前我需要安装一些东西吗?

【问题讨论】:

    标签: ruby-on-rails ruby gem middleman


    【解决方案1】:

    答案实际上在日志中。导致捆绑安装失败的 gem "wdm" 需要安装 "开发工具"。

    您可以按照there 的说明进行安装。

    【讨论】:

    • 我已经安装了开发工具包。红宝石 dk.rb 安装。我是否需要在 PATH 中添加一些东西才能使其工作。
    猜你喜欢
    • 2014-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-23
    • 1970-01-01
    • 2017-07-11
    • 2021-05-25
    • 1970-01-01
    相关资源
    最近更新 更多