当前位置:  开发笔记 > 后端 > 正文

LoadError:无法加载此类文件 - minitest/reporter

如何解决《LoadError:无法加载此类文件-minitest/reporter》经验,为你挑选了1个好方法。

我在测试数据库时遇到错误.

我有两个型号.当我添加第二个和Active Admin gem时,我开始收到错误.

 bundle exec rake test:models --trace
** Invoke test:models (first_time)
** Invoke test:prepare (first_time)
** Execute test:prepare
** Execute test:models
rake aborted!
LoadError: cannot load such file -- minitest/reporters
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/RubymineProjects/hostel_mess_pay/test/test_helper.rb:4:in `'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/RubymineProjects/hostel_mess_pay/test/models/admin_user_test.rb:1:in `'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `block in require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/activesupport-4.2.2/lib/active_support/dependencies.rb:274:in `require'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `each'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:113:in `each'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:240:in `call'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:235:in `each'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:106:in `each'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
/Users/nischaynamdev/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rake-10.5.0/bin/rake:33:in `'
/Users/nischaynamdev/.rbenv/versions/2.2.3/bin/rake:23:in `load'
/Users/nischaynamdev/.rbenv/versions/2.2.3/bin/rake:23:in `
' Tasks: TOP => test:models

这是我的gemfile:

 source 'https://rubygems.org'
    gem 'activeadmin', github: 'activeadmin'
    gem 'devise'
    gem 'cancan'
    gem 'draper'
    gem 'pundit'
    gem 'rails',        '4.2.2'
    gem 'bootstrap-sass', '~> 3.3', '>= 3.3.6'
    gem 'sass-rails',   '5.0.2'
    gem 'uglifier',     '2.5.3'
    gem 'coffee-rails', '4.1.0'
    gem 'jquery-rails', '4.0.3'
    gem 'turbolinks',   '2.3.0'
    gem 'jbuilder',     '2.2.3'
    gem 'sdoc',         '0.4.0', group: :doc

    group :development, :test do
      gem 'sqlite3',     '1.3.9'
      gem 'byebug',      '3.4.0'
      gem 'web-console', '2.0.0.beta3'
      gem 'spring',      '1.1.3'
      gem 'guard'
      gem 'guard-minitest'
    end

    group :test do
      gem 'minitest-reporters', '~> 1.1', '>= 1.1.7'
      gem 'mini_backtrace',     '0.1.3'
      gem 'ruby-prof'
    end

    group :production do
      gem 'pg',             '0.17.1'
      gem 'rails_12factor', '0.0.2'
    end

小智.. 8

尝试在你的Gemfile中添加:

gem 'minitest', group: :test
gem 'minitest-reporters', group: :test

这个对我有用.



1> 小智..:

尝试在你的Gemfile中添加:

gem 'minitest', group: :test
gem 'minitest-reporters', group: :test

这个对我有用.

推荐阅读
135369一生真爱_890
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有