所以我为dev开发了这些宝石:
gem 'autotest'
gem 'ZenTest'
gem 'autotest-growl'
在我的.autotest文件中:
require 'active_support'
require 'active_support/core_ext'
require 'autotest/restart'
require 'redgreen/autotest'
begin
require 'autotest/growl'
rescue LoadError
warn "Error loading autotest/growl. Run '[sudo] gem install autotest-growl' first."
end
Autotest::Growl::show_modified_files = false
Autotest::Growl::hide_label = true
Autotest::Growl::remote_notification = true
Autotest.add_hook :initialize do |at|
%w{.git .svn .hg .DS_Store ._* log}.each {|exception|at.add_exception(exception)}
end
如果我运行require'redgreen / autotest'或'autotest / redgreen',我会得到这些错误:
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:419:in `run_tests'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:394:in `get_to_green'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:367:in `block in run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:365:in `loop'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:365:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/lib/autotest.rb:248:in `run'
C:/RailsInstaller/Ruby2.3.3/lib/ruby/gems/2.3.0/gems/ZenTest-4.11.1/bin/autotest:6:in `<top (required)>'
C:/RailsInstaller/Ruby2.3.3/bin/autotest:22:in `load'
C:/RailsInstaller/Ruby2.3.3/bin/autotest:22:in `<main>'
Quitting
我也尝试过kule / redgreen gem,但什么都没有?如果我单独运行rspec它有颜色。在多个终端上试过,安装了ansi等。
编辑1:我的宝石文件https://gist.github.com/bbtdev/2c511c4741749db7fbffb02b6d72d9ad
编辑2:我还有一个app / autotest / discovery.rb和Autotest.add_discovery {“rspec”}我的rspec版本是3.7
编辑3:我安装了
宝石'rspec-autotest'gem'autotest-rails'
当试图添加require'redgreen / autotest'或需要'redgreen / autotest'时,除非ENV ['RSPEC']它给了我
bundler:找不到命令:C:\ RailsInstaller \ Ruby2.3.3 \ bin \ ruby -rrubygems -e require
尝试改变,
require 'redgreen/autotest'
至
require 'redgreen/autotest' unless ENV['RSPEC']
在你的.autotest
文件中。