【问题标题】:No Mocha monkey-patch for MiniTest version (RuntimeError)MiniTest 版本没有 Mocha 猴子补丁 (RuntimeError)
【发布时间】:2012-10-05 19:34:18
【问题描述】:

知道如何解决这个问题。最近当我尝试打开我的 Rails 控制台(开发和生产)时发生了这种情况。我看到了一个错误报告。但是有什么临时解决办法吗?

lib/mocha/integration/mini_test.rb:56:in `<class:TestCase>': No Mocha monkey-patch for MiniTest version (RuntimeError)
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration/mini_test.rb:20:in `<class:Unit>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration/mini_test.rb:19:in `<module:MiniTest>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration/mini_test.rb:18:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration.rb:45:in `block in <top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration.rb:44:in `each'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha/integration.rb:44:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/mocha-0.12.6/lib/mocha.rb:2:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/testing/mochaing.rb:2:in `block in <top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/core_ext/kernel/reporting.rb:11:in `block in silence_warnings'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/testing/mochaing.rb:2:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/test_case.rb:8:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/console/app.rb:2:in `<top (required)>'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:299:in `initialize_console'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/application.rb:152:in `load_console'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:27:in `start'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands/console.rb:8:in `start'
    from /Users/carlos/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.3/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 minitest


    【解决方案1】:

    好的,我想,我可以使用以前版本的 minitest 来实现这一点

    gem 'minitest', '3.5.0'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-01
      • 2012-09-16
      • 2012-12-18
      • 2020-01-09
      • 1970-01-01
      • 1970-01-01
      • 2010-09-29
      • 2021-04-04
      相关资源
      最近更新 更多