【问题标题】:Guard starts then exits?守卫开始然后退出?
【发布时间】:2013-05-12 16:16:40
【问题描述】:

我想使用 guard 来运行我的培根测试,我的 Gemfile 看起来像:

source 'https://rubygems.org'

gem 'sinatra'
gem 'sidekiq'
gem 'slim'
gem 'puma'
gem 'nokogiri'
gem 'httparty'

group :test, :development do
  gem 'guard'
  gem 'bacon'
  gem 'guard-bacon'
  gem 'libnotify'
  gem 'rb-inotify'
end

我的Guardfile 看起来像

# parameters:
#  output     => the formatted to use
#  backtrace  => number of lines, nil =  everything
guard 'bacon', :output => "BetterOutput", :backtrace => 4 do
  watch(%r{^lib/(.+)\.rb$})     { |m| "specs/lib/#{m[1]}_spec.rb" }
  watch(%r{specs/.+\.rb$})
end

当我运行guard 时,会发生以下情况

$ guard
Bacon: Using output BetterOutput.
Bacon: Limiting backtrace to 4 lines.
09:02:05 - INFO - Guard uses Libnotify to send notifications.
09:02:05 - INFO - Guard uses TerminalTitle to send notifications.
09:02:05 - INFO - Guard is now watching at '/home/martin/code/jse-api'
Guard::Bacon started.
[1] guard(main)> %                     
$

它似乎加载了所有内容,进入警卫提示并退出。

我不知道为什么?

【问题讨论】:

    标签: guard


    【解决方案1】:

    问题似乎是guard-bacon 1.1.0所需的guard版本

    如果你强制它到最新版本的守卫

    gem 'guard', '>= 1.8.0'
    

    它回退到旧版本的 guard-bacon 1.0.5 并且一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-01-29
      • 1970-01-01
      • 1970-01-01
      • 2017-11-27
      • 2013-03-31
      • 2020-02-14
      相关资源
      最近更新 更多