加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby – 在Windows系统上安装’wdm’gem时出错

发布时间:2020-12-17 03:41:49 所属栏目:百科 来源:网络整理
导读:我在 Windows 7系统上全新安装了 Ruby 2.2.1(32位).我还安装了devkit而没有任何报告错误.当然我以为我可以安装’wdm’宝石: gem install wdm 但是,它出错了.整个输出有点多发布整个事情所以截断了以下几点. C:/Ruby22/bin/ruby.exe -r ./siteconf20150318-1
我在 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:Ruby22librubygems2.2.0gemswdm-0.1.0extwdm/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

我错过了什么?

解决方法

wdm gem与2.2不兼容.它调用函数rb_thread_blocking_region(),它在2.0中被弃用,最后是 removed in 2.2.此外,gem不再被维护(参见其 repository and issue tracker).

您可以分叉回购,合并the existing PR that apparently fixes the issue,并自己构建gem.使用较旧的Ruby版本也是一种解决方案.

更新:
wdm gem刚刚更新到0.1.1.该版本修复了该错误.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读