我最近设置了 Zeus 和 Minitest 来测试 Rails 应用程序。
但是,我收到以下错误:
leo% zeus test
/Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/turn-0.9.6/lib/turn/minitest.rb:23:in `<top (required)>': MiniTest v5.0.8 is out of date.
`gem install minitest` and add `gem 'minitest' to you test helper. (RuntimeError)
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
... etc ...
Turn gem 中提到的行是:
# set MiniTest's runner to Turn::MiniRunner instance
if MiniTest::Unit.respond_to?(:runner=)
MiniTest::Unit.runner = Turn::MiniRunner.new
else
raise "MiniTest v#{MiniTest::Unit::VERSION} is out of date.\n" \
"`gem install minitest` and add `gem 'minitest' to you test helper."
#MiniTest::Unit = Turn::MiniRunner
end
所以“过时”可能有点误导。它真正的意思是 API 不是预期的,对吧?
我gem 'turn'
从我的 Gemfile 中删除,运行bundle install
并重新启动 Zeus。
现在我得到:
/Users/leo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:328:in `autorun': uninitialized class variable @@installed_at_exit in Test::Unit::Runner (NameError)
from /Users/leo/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/test/unit.rb:640:in `<top (required)>'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/leo/.rvm/gems/ruby-1.9.3-p125@backscratchers/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `l
... etc ...
这里发生了什么?我是否有错误的 Minitest 版本?为什么 Bundler 无法弄清楚依赖链,我认为这就是重点。
任何建议都非常感谢。