Ruby 报错 aggregated_results: wrong number of arguments (given 1, expected 0)

在rails中,使用rake命令或者test命令中抛出了一个错误:

Finished in 0.316243s, 50.5940 runs/s, 88.5395 assertions/s.
.../.rvm/gems/[email protected]/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/[email protected]/gems/minitest-5.10.2/lib/minitest.rb:597:in `report'
    from .../.rvm/gems/[email protected]/gems/minitest-5.10.2/lib/minitest.rb:687:in `each'
    from .../.rvm/gems/[email protected]/gems/minitest-5.10.2/lib/minitest.rb:687:in `report'
    from .../.rvm/gems/[email protected]/gems/minitest-5.10.2/lib/minitest.rb:141:in `run'
    from .../.rvm/gems/[email protected]/gems/railties-5.0.2/lib/rails/test_unit/minitest_plugin.rb:72:in `run'
    from .../.rvm/gems/[email protected]/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即可解决。

你可能感兴趣的:(Ruby 报错 aggregated_results: wrong number of arguments (given 1, expected 0))