在rails中,使用rake
命令或者test
命令中抛出了一个错误:
Finished in 0.316243s, 50.5940 runs/s, 88.5395 assertions/s.
.../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:9:in `aggregated_results': wrong number of arguments (given 1, expected 0) (ArgumentError)
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/minitest-5.10.2/lib/minitest.rb:597:in `report'
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/minitest-5.10.2/lib/minitest.rb:687:in `each'
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/minitest-5.10.2/lib/minitest.rb:687:in `report'
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/minitest-5.10.2/lib/minitest.rb:141:in `run'
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:72:in `run'
from .../.rvm/gems/ruby-2.4.1@ruby2.4.1-rails5.0/gems/minitest-5.10.2/lib/minitest.rb:63:in `block in autorun'
这是一个bug,rails在这次更新中修复了它rails/rails#29022,但是因为种种原因,不想更新版本怎么办?
在Gemfile
中加入这样一行:
gem "minitest", "5.10.1"
在对应的环境(test或者development)下,再执行bundle install
即可解决。