0

我在 Rails 上非常新,我有一个问题,我试图在本地机器上设置我的项目(项目已经开始)并且我得到了大量的错误,我首先做了一个bundle install,然后在下载所有 gem 和库后我试过了rails server,我的问题是我得到了很多错误,我不知道我必须安装或做什么才能让它运行。

任何的想法?这是我的外壳结果

我想我必须安装一些库..知道这些问题吗?

C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter.rb:195:in `
require': cannot load such file -- wdm (LoadError)

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:195:in `load_dependent_adapter'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
s/windows.rb:33:in `load_dependent_adapter'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:187:in `usable?'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
s/windows.rb:25:in `usable?'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:179:in `usable_and_works?'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:49:in `block in select_and_initialize'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:47:in `each'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/adapter
.rb:47:in `select_and_initialize'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/listene
r.rb:267:in `initialize_adapter'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/listene
r.rb:259:in `setup'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-1.0.2/lib/listen/listene
r.rb:49:in `start'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:194:in
 `block in start'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:368:in
 `block in within_preserved_state'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:365:in
 `synchronize'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:365:in
 `within_preserved_state'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard.rb:190:in
 `start'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/lib/guard/cli.rb:11
0:in `start'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb
:27:in `run'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation
.rb:120:in `invoke_command'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor.rb:363:in
`dispatch'

        from C:/Ruby200/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/base.rb:43
9:in `start'

from C:/Ruby200/lib/ruby/gems/2.0.0/gems/guard-1.8.0/bin/guard:6:in `<to
p (required)>'

from C:/Ruby200/bin/guard:23:in `load'
from C:/Ruby200/bin/guard:23:in `<main>'
4

2 回答 2

2

这只是一个错误,它只是向您展示了整个堆栈。也就是说,看第一行: "C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-.0.2/lib/listen/adapter.rb:195:in 'require': cannot load such file -- wdm (LoadError)"

这就是错误的根源。之后的行向您展示了调用了哪些方法才能到达那里。

所以你只需要解决 "C:/Ruby200/lib/ruby/gems/2.0.0/gems/listen-.0.2/lib/listen/adapter.rb:195:in 'require': cannot load such file -- wdm (LoadError)"

我最初在这里找到了答案:Guard won't load WDM

Listen gem 需要 WDM Gem 才能在 Windows 上正常工作。您可以通过将此行添加到 Gemfile 来完成此操作:

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

这一行简单地说,如果您的操作系统是“mwin”或“mingw”,则需要“wdm”gem。

保存 Gemfile 后,bundler install再次运行以确保安装 wdm。

于 2013-06-12T22:07:28.570 回答
0

我正在使用 Windows 8 并遇到这个“--wdm (LoadError)”,我只是在运行 ruby​​(不是使用 rails),一个简单的“gem install wdm”就可以了。

于 2013-11-12T12:34:11.997 回答