我正在尝试在 Ubuntu 上设置自动测试,无论我的配置如何,我都会得到以下信息:
loading autotest/rails_rspec2
style: RailsRspec2
/home/brian/.rvm/gems/ruby-1.9.2-rc2@rails3tutorial/gems/redgreen-1.2.2/lib/redgreen/autotest.rb:6:in `<top (required)>': uninitialized constant Object::PLATFORM (NameError)
我拥有的 .autotest (~/.autotest) 文件如下:
#!/usr/bin/env ruby
require 'redgreen/autotest'
def self.notify title, msg, img, pri='low', time=3000
`notify-send -i #{img} -u #{pri} -t #{time} '#{msg}'`
end
Autotest.add_hook :ran_command do |at|
results = [at.results].flatten.join("\n")
output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+not implemented)?(,\s*(\d+)\s+pending)?/)
folder = "~/Pictures/autotest/"
if output =~ /([123456789]|[\d]{2,})\sfailures?/
notify "FAIL:", "#{output}", folder+"rails_fail.png", 'critical', 10000
elsif output =~ /[1-9]\d*\spending?/
notify "PENDING:", "#{output}", folder+"rails_pending.png", 'normal', 10000
else
notify "PASS:", "#{output}", folder+"rails_ok.png"
end
end
我在这里做错了什么?
答案1
我有同样的问题。
我刚刚require 'redgreen/autotest'
从 ~/.autotest 中删除了它,如果您正在使用 bundler,那么您gem 'redgreen'
也应该删除它。
我没有对这个问题进行进一步调查...