安装wdm gem时出现错误信息

时间:2016-12-07 23:41:32

标签: ruby rubygems jekyll

我在这里关注安装jekyll:labs.sverrirs.com/jekyll/5-wdm-gem.html

但我似乎无法安装wdm。我安装了Ruby-devkit和ruby2.3 64bit。但是,当我尝试输入gem install wdm时,它会显示:

要查看此扩展无法编译的原因,请查看mkmf.log中的哪个可以  在这里找到:

 C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/wdm-0.1.1/mkmf.
log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.
1.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0
/wdm-0.1.1/gem_make.out

mkmf文件说明了这一点:

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby23-x64/include/ruby-2.3.0/x64-mingw32 -IC:/Ruby23-x64/include/ruby-2.3.0/ruby/backward -IC:/Ruby23-x64/include/ruby-2.3.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat conftest.c  -L. -LC:/Ruby23-x64/lib -L.      -lx64-msvcrt-ruby230  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

我不知道这意味着什么,该做什么?

宝石文件:

    current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/wdm-0.1.1/ext/wdm
C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20161205-2832-xgt8yg.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:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
    --with-kernel32lib
    --without-kernel32lib
C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:541:in `try_link0'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
    from C:/Ruby23-x64/lib/ruby/2.3.0/mkmf.rb:992:in `have_library'
    from extconf.rb:19:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/wdm-0.1.1/mkmf.log

extconf failed, exit code 1

1 个答案:

答案 0 :(得分:0)

您能否粘贴mkmf.log文件和gem_make.out的内容?

我只是尝试在运行Ruby 64bit的Win10上安装gem,这似乎不是问题。

编辑:好的,错误说明您的devkit未正确安装。您是否按照ruby网站上的说明操作并为您的ruby版本安装了正确的版本?