【发布时间】:2016-12-07 23:41:32
【问题描述】:
我在此处按照本指南安装 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 */
我不知道这意味着什么,该怎么办?
gem 文件:
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
【问题讨论】:
-
FWIW: rubyinstaller.org/downloads 声明“Ruby 的 64 位版本在 Windows 领域相对较新,并非所有软件包都已更新以兼容它。要使用此版本,您需要一些关于编译器和解决依赖问题的知识,如果你只是想玩这个语言,这可能太复杂了。”您可能希望在 Windows 上采用 32 位路由。 YMMV。
-
似乎不是 64 位问题,在运行 ruby-x64 的 win10x64 上对我来说工作正常