我在Windows 7系统上全新安装了Ruby 2.2.1(32位)。我还安装了devkit而没有任何报告错误。当然,我以为我可以安装“wdm”'宝石:
gem install wdm
然而,它出错了。整个输出有点过分发布整个事情所以截断了以下几点。
C:/Ruby22/bin/ruby.exe -r ./siteconf20150318-1712-oq5nlb.rb extconf.rb
checking for main() in -lkernel32... yes
checking for windows.h... yes
checking for ruby.h... yes
checking for HAVE_RUBY_ENCODING_H... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating wdm_ext-i386-mingw32.def
compiling entry.c
In file included from entry.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
...
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
...
warning: #warning Please include winsock2.h before windows.h [-Wcpp]
compiling monitor.c (this is repeated for multiple *.c files)
...
rb_monitor.o: In function `rb_monitor_run_bang':
C:\Ruby22\lib\ruby\gems\2.2.0\gems\wdm-0.1.0\ext\wdm/rb_monitor.c:508: undefined reference to `rb_thread_blocking_region'
collect2.exe: error: ld returned 1 exit status
make: *** [wdm_ext.so] Error 1
make failed, exit code 2
我错过了什么吗?
答案 0 :(得分:8)
wdm
宝石与2.2兼容。它调用在2.0中弃用的函数rb_thread_blocking_region()
,最后调用removed in 2.2。宝石也不再维护(见repository and issue tracker)。
您可以分叉回购,合并the existing PR that apparently fixes the issue,并自己构建gem。使用较旧的Ruby版本也是一种解决方案。
<强>更新强>
wdm
gem之前已更新为0.1.1。此版本修复了该错误。