Guard 不会加载 WDM [英] Guard won't load WDM

查看:82
本文介绍了Guard 不会加载 WDM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习 Michael Hartl 的 Rails 教程,该教程目前非常出色.我在高级设置章节,他在那里以有利于 TDD 的方式配置 Rails 环境.我安装了 Guard,它通过运行我在我的 spec/文件夹中的测试一直正常运行.但是,它吐出这个错误:

I'm working through Michael Hartl's Rails tutorial which is excellent so far. I'm on the Advanced Setup Chapter, where he goes through configuring the Rails environment in a way conducive to TDD. I installed Guard, and it runs properly all the way through running the tests I have in my spec/ folder. But then, it spits out this error:

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

我已经安装了 wdm.我不知道为什么它无法加载它.

I have wdm installed. I don't know why it can't load it.

Listen 似乎在加载 WDM 时遇到问题.它在说守卫现在正在观看......"后退出.

It seems like Listen is having problems loading up WDM. It quits after it says "Guard is now watching..."

出于明显的原因,我没有复制堆栈跟踪的其余部分.我使用最新的 Rails 安装程序安装了 Rails.这里发生了什么?我需要担心这个吗?它似乎至少部分起作用...

I haven't reproduced the rest of the stack trace for obvious reasons. I installed Rails using the latest Rails Installer. What's going on here? Do I need to worry about this? It appears to work at least partially...

推荐答案

这就是发生的事情.默认情况下,在 Windows 上,Listen 应该使用轮询来检查文件系统更改.出于某种原因,它试图使用 WDM.所以,我必须把这个放到我的 Gemfile 中:

So here's what happened. By default, on Windows, Listen is supposed to use polling to check for filesystem changes. For some reason it was trying to use WDM. So, I had to had this to my Gemfile:

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

也许 Guard 让 Listen 尝试使用 WDM?

Maybe Guard makes Listen try to use WDM?

这篇关于Guard 不会加载 WDM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆