Windows: Cannot Load Such File -- WDM #1470

Closed
srsgores opened this Issue Dec 7, 2013 · 14 comments
@srsgores

I just updated my compass gem to 1.0.0.15 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:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/ruby200/bin/ruby
        --with-kernel32lib
        --without-kernel32lib
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?

@mprins

if you haven't already install the ruby developer tools: http://rubyinstaller.org/add-ons/devkit/ 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.

@jmcguerreiro

If you need step by step instructions follow this stackoverflow answer: http://stackoverflow.com/a/19306476

@scottdavis
Compass member

Has this been resolved?

@XNerv

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

@srsgores

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
Closed

'grunt server' fails on Windows #46

@alecsandre

Hi,
after installing devkit from http://rubyinstaller.org/downloads/ and reinstalling wdm everithing worked for me

@chriseppstein
Compass member
@zdislaw

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"

@pyrsmk

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

@KatieK2

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:

C:\Web\styles
λ 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/lib/compass/exec/sub_command_ui.rb:43:in
`perform!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-1.0.0.alpha.19/lib/compass/exec/sub_command_ui.rb:15:in
`run!'
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>'


C:\Webbie\PewPewLaserBlog\styles
λ sass --ver
Sass 3.3.6 (Maptastic Maple)


C:\Webbie\PewPewLaserBlog\styles
λ 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: http://umdf.org/compass
@Arcovion

@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.

@KatieK2

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

@Arcovion

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.

@Arcovion

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