Windows: Installing wdm fails due to incompatibility with Ruby 2.2 #3721

Closed
kleinfreund opened this Issue May 21, 2015 · 18 comments

Projects

None yet

4 participants

@kleinfreund
Contributor

According to this answer on Stack Overflow, the wdm gem is not compatible with Ruby 2.2. Installing it will fail.

This introduces some issues on Windows, becuase jekyll serve is no longer polling for changes (as indicated by the warning message telling you to use wdm).

For the protocol, here is the lengthy error message that's produced on gem install wdm.

Also there appears to be the possibility to compile the gem on your own with this pull request merged.

$ gem install wdm
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing wdm:
        ERROR: Failed to build gem native extension.

    c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150521-4240-11brsuf.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-x64-mingw32.def
compiling entry.c
In file included from entry.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from entry.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from entry.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from entry.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling memory.c
In file included from memory.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from memory.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from memory.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from memory.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling monitor.c
In file included from monitor.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from monitor.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from monitor.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from monitor.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling queue.c
In file included from queue.c:3:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/vadefs.h:13:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdarg.h:140,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/include/stdarg.h:1,
                 from queue.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from queue.c:3:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from queue.c:3:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling rb_change.c
In file included from rb_change.c:4:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdlib.h:9,
                 from rb_change.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from rb_change.c:4:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from rb_change.c:4:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling rb_monitor.c
In file included from rb_monitor.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from rb_monitor.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from rb_monitor.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from rb_monitor.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
rb_monitor.c: In function 'rb_monitor_run_bang':
rb_monitor.c:508:9: warning: implicit declaration of function 'rb_thread_blockin
g_region' [-Wimplicit-function-declaration]
compiling utils.c
In file included from utils.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from utils.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from utils.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from utils.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
compiling wdm.c
In file included from wdm.c:1:0:
wdm.h:3:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/crtdefs.h:10:0,
                 from c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.
2/../../../../x86_64-w64-mingw32/include/stdio.h:9,
                 from wdm.h:1,
                 from wdm.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/_mingw.h:248:0: note: this is the location of the previous de
finition
In file included from wdm.c:1:0:
wdm.h:4:0: warning: "_WIN32_WINNT" redefined [enabled by default]
<command-line>:0:0: note: this is the location of the previous definition
In file included from c:/Ruby22-x64/include/ruby-2.2.0/ruby/win32.h:38:0,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:163,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from c:/Ruby22-x64/include/ruby-2.2.0/ruby.h:33,
                 from wdm.h:12,
                 from wdm.c:1:
c:\rubydevkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w
64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h
before windows.h [-Wcpp]
linking shared-object wdm_ext.so
rb_monitor.o: In function `rb_monitor_run_bang':
c:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\wdm-0.1.0\ext\wdm/rb_monitor.c:508: undef
ined 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

Gem files will remain installed in c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/wdm-0.
1.0 for inspection.
Results logged to c:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0
/wdm-0.1.0/gem_make.out
@kleinfreund
Contributor

I also noticed that content would not be updated even with restarting jekyll s. I currently need to do a rm _site/* -r and rebuild to test my changes. Is this related to this issue or is that a 3.0 thing?

I'm running beta 5.

@envygeeks
Member

Well it's rather hard to tell whether it would be us or that. The main question is, did you compile it yourself with the fix and are having that issue? Did you remove the gem and are having the issue? Are you polling? We need more information for this to be diagnostically feasible.

@kleinfreund
Contributor

I do not have the fixed version nor do I have any version of wdm installed. I'm not changing the default behavior of Jekyll or Listen currently (--force_polling doesn't change the behavior here).

I can get a little bit more precise with my other issue: I change a line in a blog post and changes are applied when refreshing the page for the post, but not when refreshing the blog index page.

@kleinfreund
Contributor

Uh, yikes. It might actually be something different entirely. I switched to another project and did jekyll s. Now I'm seeing the content of the previous page, but without any assets applied (no CSS, no graphics, just the plain HTML content). Switching the browser solves that issue.

@envygeeks
Member

That's a bug in incremental regeneration and one I am running into as well and it's related to incremental regeneration /cc @alfredxing for now you can disable it with full_rebuild: true in your config.

@kleinfreund
Contributor

Alright, thanks. So this is just an issue for gem install wdm not working for Ruby 2.2 then.

@envygeeks
Member

I haven't ever actually played with or even looked at what we do on Windows but do we install wdm on Windows directly or is that an indirect result of another dependency? Can you run gem dependency wdm --reverse-dependencies

@kleinfreund
Contributor

No, we don't. We print out a warning when doing jekyll s like this:

  Please add the following to your Gemfile to avoid polling for changes:
    gem 'wdm', '>= 0.1.0' if Gem.win_platform?

That said, I'd prefer suggesting gem install wdm because that's the default way of installing Jekyll. I never touched a Gemfile and don't even know what it's doing.

I can't do gem dependency wdm --reverse-dependencies because I can't installd wdm.

@envygeeks
Member

I think everybody and @jekyll/core will have to decide what to do because we are coming up on a new version of Windows soon and if this dependency doesn't work on Windows right we will just exacerbate a situation that can be resolved by telling Windows users that boot2docker exists now and we have stable Jekyll images that would work great for them.

@TWiStErRob
Contributor

Here's a workaround while Maher4Ever/wdm#16 is being merged. Replace

gem 'wdm', '>= 0.1.0' if Gem.win_platform?

with

gem 'wdm', :git => 'git://github.com/lowjoel/wdm.git' if Gem.win_platform?
@envygeeks
Member

/cc @jekyll/core @kleinfreund agree or disagree?

@kleinfreund
Contributor

The PR is there for almost a year now. Not sure if it's going to get merged. As a temporary workaround the above should do it, I think.

@TWiStErRob
Contributor

Ah, I didn't mean to commit :). Though it would probably help. The problem is that github-pages gem (latest: v37) is lagging behind with 2.4.0, so it won't get picked up for a while.

Btw, I wrote an email to maintainer, well see what he says.

@TWiStErRob
Contributor

No reponse yet, and his last activity is beginning of 2013. I think we can say WDM is abandoned?

@GeekinaCave

OK; for the people like me who got problems for using wdm on ruby 2.2.x, i found the way to repacked the fix into a *.gem for local installation. At least until this fix will be merged into the original gem:

https://github.com/ABCDIY/wdm.gem_for_Ruby_2.2.X

Regards

@kleinfreund
Contributor

This is fixed with the new release of wdm v0.1.1.

@envygeeks
Member

I didn't see that coming but when it just zoomed past my inbox I was happy!

@kleinfreund
Contributor

Yeah, I just zoned out in my CLI and typed in gem install wdm and it just worked. Good stuff.

@danielpclark danielpclark referenced this issue in danielpclark/faster_path Jun 10, 2016
Closed

Rust on Windows does not add lib prefix #2

@VincentTam VincentTam added a commit to VincentTam/vincenttam.github.io that referenced this issue Jan 9, 2017
@VincentTam VincentTam Upgraded Ruby to 2.3.3
wdm: jekyll/jekyll#3721
Release 0.1.1 fixes this issue
rake: http://stackoverflow.com/a/36925869/3184351
Though "rake install" gives no response, "rake preview" works.
f50a0d4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment