Windows: Cannot Load Such File -- WDM #1470

srsgores opened this Issue Dec 7, 2013 · 14 comments

I just updated my compass gem to alpha, and I now get the following error when compiling:

LoadError on line ["45"] of C: cannot load such file -- wdm
Run with --trace to see the full backtrace

this issue says that I should do gem install wdm, but that fails as well:

ERROR:  Error installing wdm:
        ERROR: Failed to build gem native extension.

    C:/ruby200/bin/ruby.exe 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:
C:/ruby200/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:530:in `try_link'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:716:in `try_func'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:946:in `block in have_library'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
        from C:/ruby200/lib/ruby/2.0.0/mkmf.rb:941:in `have_library'
        from extconf.rb:19:in `<main>'

Any ideas on how to best proceed?


if you haven't already install the ruby developer tools: you need those to build/install native extensions.

Next, in your Gemfile, add:
require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i

I ran into this when setting up Jekyll and this fixed it.


If you need step by step instructions follow this stackoverflow answer:

Compass member

Has this been resolved?


Same problem for me here. Only install wdm did not solve the problem on windows 7 64 bits and ruby 1.93 with compass 1.0.0.alpha.17

I put this on my gemfile:

require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i


Hey guys,

I managed to fix the problem. @jmcguerreiro was right in that I needed to install dev tools. After installing dev tools, do this:

gem install wdm

The part I hadn't done was initialized them properly. Then I was able to build native extensions, and the error was gone.

@srsgores srsgores closed this Jan 19, 2014
@webmaven webmaven referenced this issue in north/generator-style-prototype Feb 21, 2014

'grunt server' fails on Windows #46


after installing devkit from and reinstalling wdm everithing worked for me

Compass member

I think so. I can verify that I was unable to run compass watch on my Windows7 machine until installing ruby dev tools and then running "gem install wdm"


Should be a great idea to have docs for windows users ^^


I currently get this error on Windows 7 when running compass watch --trace. I've just upgraded to Sass 3.3.6 and Compass 1.0.0.alpha.19. Not using any maps, though.

Do I really have to upgrade my entire Ruby environment to handle this?

Here is a more complete console capture:

λ compass watch --trace
>>> Compass is watching for changes. Press Ctrl-C to Stop.
unchanged ../images/site-styles/sm-links-s1b1449c5e3.png
overwrite ./main.css
LoadError on line ["36"] of C: cannot load such file -- wdm
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:199:in `load_dependent_adapter'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapters/windows.rb:33:in `load_dependent_adapter'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:190:in `usable?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapters/windows.rb:25:in `usable?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:182:in `usable_and_works?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:49:in `block in select_and_initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/adapter.rb:47:in `select_and_initialize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:272:in `initialize_adapter'

C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:264:in `setup'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.1.6/lib/listen/listener.rb:64:in `start!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/watcher/project_watcher.rb:31:in `watch!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/commands/watch_project.rb:48:in `perform'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/commands/base.rb:18:in `execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/commands/project_base.rb:19:in `execute'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/bin/compass:30:in `block in <top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/bin/compass:44:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/bin/compass:44:in `<top (required)>'
C:/Ruby193/bin/compass:23:in `load'
C:/Ruby193/bin/compass:23:in `<main>'

λ sass --ver
Sass 3.3.6 (Maptastic Maple)

λ compass --ver
Compass 1.0.0.alpha.19
Copyright (c) 2008-2014 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause:

@KatieK2 WDM is the best way to watch directories on Windows, it makes use of a C extension instead of polling so it's blazing fast - the DevKit is just there to bring in binaries like GCC and all the MSYS utilities in order to build the extension.

It's not a big deal, just extract the DevKit and run:

ruby dk.rb init
ruby dk.rb install
gem install wdm

Compass is not to blame here, the listen gem (used in Sass 3.3, which is what compass now uses) should raise a clearer error message of what to do when WDM is not found and explain that DevKit is required. Please open a ticket there if problems persist.


For right now, I found it easier just to revert to the previous (stable) version of Compass.


Come to think of it, you're actually on a very old version of listen. The new gem has better error messages and is still able to fall back to polling if WDM doesn't work.

Try updating listen to 2.7.5 and see what happens, I guess since Sass unbundled listen for ruby versions 1.8.7+ that updating Sass by itself doesn't update the listen gem. Not 100% sure... but worth a try.


Ok, so that's not possible:

λ gem dependency compass -v 1.0.0.alpha.19
Gem compass-1.0.0.alpha.19
  chunky_png (~> 1.2)
  compass-core (~> 1.0.0.alpha.19)
  compass-import-once (~> 1.0.3)
  json (>= 0)
  listen (~> 1.1.0)
  sass (< 3.5, >= 3.3.0)

Note that the previous version of compass looked like this:

λ gem dependency compass -v 0.12.2
Gem compass-0.12.2
  chunky_png (~> 1.2)
  fssm (>= 0.2.7)
  sass (~> 3.1)

So listen was only recently added as a compass dependency, it's best to remove it again if possible.
See the issue referenced below for further discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment