2013-12-08 15 views
8

Tôi đã gặp một số vấn đề lớn với Jekyll trên cửa sổ. Tôi cuối cùng đã làm cho nó làm việc vì vậy tôi chạyLỗi Ruby: không thể tải tệp như vậy - wdm (LoadError)

jekyll build

Sau đó

jekyll serve --watch

Sau đó, tôi nhận được lỗi sau, bất cứ ai có thể giúp đỡ?

Các lỗi đầy đủ là:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': 
cannot load such file -- wdm (LoadError) 
     from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i 
n `require' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:207:in `load_dependent_adapter' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
s/windows.rb:33:in `load_dependent_adapter' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:198:in `usable?' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
s/windows.rb:25:in `usable?' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:190:in `usable_and_works?' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:57:in `block in select_and_initialize' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:55:in `each' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter 
.rb:55:in `select_and_initialize' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listene 
r.rb:291:in `initialize_adapter' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listene 
r.rb:283:in `setup' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/listene 
r.rb:52:in `start' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.0/lib/jekyll/command 
s/build.rb:56:in `watch' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.0/lib/jekyll/command 
s/build.rb:8:in `process' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-1.4.0/bin/jekyll:97:in ` 
block (2 levels) in <top (required)>' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/c 
ommand.rb:180:in `call' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/c 
ommand.rb:180:in `call' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/c 
ommand.rb:155:in `run' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/r 
unner.rb:402:in `run_active_command' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/r 
unner.rb:66:in `run!' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/d 
elegates.rb:11:in `run!' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/commander-4.1.5/lib/commander/i 
mport.rb:10:in `block in <top (required)>' 

Trả lời

8

Bạn dường như đang chạy trên một phiên bản rất cũ của listen đá quý (1.3.1). Cố gắng cập nhật mới nhất (2.4.0)

$ gem update listen 

Trong bạn Gemfile:

require 'rbconfig' 

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

Added viên ngọc wdm kể từ khi tôi không chắc chắn nếu nghe ngọc sẽ require it by itself nhưng như readme tuyên bố điều này là tùy chọn, nếu không nó sẽ dự phòng bỏ phiếu là một cách ít hiệu quả hơn để thực hiện nó.

+0

Nói rằng mặc dù, chạy xem lại sau dòng đó và tôi vẫn gặp lỗi. Lạ thật, nó đã hoạt động một lúc trước. Nó cho thấy nó không thể tìm thấy wdm mặc dù hai dòng đang có mặt. – Doidgey

+0

'bó exec jekyll phục vụ - watch' –

+1

Aha, tôi nghĩ rằng thats thực hiện nó! tôn trọng con người. – Doidgey

3

This blog post nói:

# If you get the following error with the –watch option 

C:/Ruby193/lib/ruby/gems/1.9.1/gems/listen-1.3.1/lib/listen/adapter.rb:207:in `require': cannot load such file -- wdm (LoadError) 

# To fix that error, open the gemfile in your jekyll project directory and add these two lines: 

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

Cảm ơn vì điều này :) – Doidgey

10

Tôi gặp vấn đề tương tự. Đã khắc phục sự cố rất đơn giản bằng cách đặt "Windows Directory Monitor".

gem install wdm 

Và Bao gồm dòng này trong Gemfile:

gem 'wdm' 

Chúc may mắn!

+3

Làm việc cho tôi ... – user1429980

+0

Làm việc cho tôi! Cảm ơn. –

Các vấn đề liên quan