简体   繁体   English

在Windows机器上安装ruby gems时,“ install bundler”出现错误

[英]error in `install bundler` while installing ruby gems on windows machine

I am trying to intsall middleman - a static site generator, which uses ruby gems. 我正在尝试整合中间人-使用红宝石宝石的静态网站生成器。 It is able to build all native extensions but not wdm. 它能够构建所有本机扩展,但不能构建wdm。 I am getting the below error message when I run install bundler command in my command prompt. 在命令提示符下运行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.

Do I need to install something before running it. 我需要先安装某些东西然后再运行它。

The answer is in the logs actually. 答案实际上是在日志中。 the gem "wdm" which makes the bundle install fail requires the "development tools" to be installed. 导致捆绑安装失败的gem“ wdm”需要安装“开发工具”。

You can install those by following the instructions there . 您可以按照那里的说明进行安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM