Windows 7上的Guard失败,出现运行时错误



跑步

$bundle exec guard

ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
Rails 3.2.11
Guard version 1.6.1

在Windows 7 64位上失败,对于我来说:

17:49:03 - INFO - Guard uses Notifu to send notifications.
17:49:03 - INFO - Guard uses TerminalTitle to send notifications.
C:/Ruby193/lib/ruby/gems/1.9.1/gems/pry-0.9.11.3-x86-mingw32/lib/pry/command_set
.rb:216:in `alias_command': Command: `help` not found (RuntimeError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard/interacto
r.rb:135:in `block in create_command_aliases'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard/interacto
r.rb:134:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard/interacto
r.rb:134:in `create_command_aliases'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard/interacto
r.rb:95:in `initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard.rb:161:in
 `new'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard.rb:161:in
 `setup_interactor'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard.rb:82:in
`setup'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard.rb:183:in
 `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/lib/guard/cli.rb:11
0:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27
:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation
.rb:120:in `invoke_task'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor.rb:275:in
`dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:42
5:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/guard-1.6.1/bin/guard:6:in `<to
p (required)>'
        from C:/Ruby193/bin/guard:23:in `load'
        from C:/Ruby193/bin/guard:23:in `<main>'

我需要以特定的方式开始通知吗?我错过了什么?

RKing已经向Guard提交了一个问题,并将您的问题与它联系起来。看起来这要么是最新的Pry问题,要么是Guard没有正确使用Pry API。

我想到了两件事来解决这个问题:

  1. 禁用交互器

    由于Pry仅在交互器中使用,所以您可以在启动Guard时禁用它,并且您应该至少有Guard插件工作:

    $ bundle exec guard -i

  2. 查找最后一个可用的Pry版本

    我认为你应该让它在旧版本的Pry上运行,问题是哪个版本引入了不兼容性。您可以通过在Gemfile中指定版本并运行捆绑器来使用固定的Pry版本:

    在你的Gemfile:

    gem 'pry', '0.9.11.2'

    然后在控制台上运行bundler:

    $ bundle update

    如果它仍然不起作用,就使用低版本。请尝试0.9.11.2, 0.9.11.1, 0.9.110.9.10

    如果你发现了一个可用的版本,请报告给GitHub链接的守卫问题。

相关内容

最新更新