Guard在Windows 7(64位)上给出错误
嗨社区成员,我是ruby的新手,我正在尝试学习rspec,并且正在使用guard运行rspec示例。
我在发出命令之前尝试运行一个简单的rspec示例(通过设置以下环境) 守卫观察rspec资源
ruby-1.9.3p545
rspec-3.0.0
guard-2.6.2
guard-rspec-4.2.9
日志:
C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/adapter/windows.rb:21:in `rescue in usable?': undefined method `_log' for Listen::Adapter::Windows:Class (NoMethodError)
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/adapter/windows.rb:17:in `usable?'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/adapter.rb:32:in `each'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listn/adapter.rb:32:in `detect'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/adapter.rb:32:in `_usable_adapter_class'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/adapter.rb:20:in `select'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/listener.rb:252:in `_adapter_class'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/listener.rb:208:in `_init_actors'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/listener.rb:72:in `block in <class:Listener>'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/fsm.rb:175:in `instance_eval'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/fsm.rb:175:in `call'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/fsm.rb:127:in `transition_with_callbacks!'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.15.2/lib/celluloid/fsm.rb:95:in `transition'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/listen-2.7.6/lib/listen/listener.rb:85:in `start'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/lib/guard/commander.rb:30:in `block in start'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/lib/guard/commander.rb:108:in `block in within_preserved_state'
from <internal:prelude>:10:in `synchronize'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/lib/guard/commander.rb:105:in `within_preserved_state'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/lib/guard/commander.rb:26:in `start'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/lib/guard/cli.rb:107:in `start'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from C:/softwares/Ruby193/lib/ruby/gems/1.9.1/gems/guard-2.6.1/bin/guard:6:in `<top (required)>'
from C:/softwares/Ruby193/bin/guard:23:in `load'
from C:/softwares/Ruby193/bin/guard:23:in `<main>'
请在此处说明问题所在。 我非常感谢你的帮助。
NB
答案 0 :(得分:3)
我遇到了同样的问题。
看起来这可能是今天发布的listen 2.7.6版本的问题。尝试手动安装listen 2.6.5:
如果你正在使用bundler:
gem 'listen', '2.7.5'
如果您使用rubygems安装:
gem uninstall listen
gem install listen -v 2.7.5
编辑:对于任何googlers,版本2.7.9现已推出,使得这个答案过时。