Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installed 'wdm' gem on Windows system

Tags:

ruby

rubygems

I have a fresh install of Ruby 2.2.1 (32-bit) on my Windows 7 system. I also installed the devkit without any reported errors. Naturally I thought I could just install the 'wdm' gem with:

gem install wdm

However, it errors out. The entire output is a bit much to post the entire thing so truncated the following points come up.

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

Did I miss something?

like image 682
cdeterman Avatar asked Feb 11 '23 15:02

cdeterman


1 Answers

The wdm gem isn't compatible with 2.2. It calls the function rb_thread_blocking_region() which was deprecated in 2.0 and finally removed in 2.2. Also the gem isn't maintained anymore (see its repository and issue tracker).

You could fork the repo, merge the existing PR that apparently fixes the issue, and build the gem by yourself. Using an older Ruby version could be a solution too.

Update: The wdm gem was updated to 0.1.1 a while ago. The error is fixed by this version.

like image 87
cremno Avatar answered Feb 25 '23 02:02

cremno