Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LoadError: cannot load such file -- minitest/reporters

I am getting an error while testing my database.

I have two models. When I added the second one and the Active Admin gem I started getting the error.

 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 `<top (required)>'
/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 `<top (required)>'
/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 `<top (required)>'
/Users/nischaynamdev/.rbenv/versions/2.2.3/bin/rake:23:in `load'
/Users/nischaynamdev/.rbenv/versions/2.2.3/bin/rake:23:in `<main>'
Tasks: TOP => test:models

This is my 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
like image 325
Nischay Namdev Avatar asked Feb 14 '16 18:02

Nischay Namdev


2 Answers

Try to add this in you Gemfile:

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

It works for me.

like image 53
L. Ren Avatar answered Oct 20 '22 05:10

L. Ren


Have you tried this:

In your test_helper.rb file, add the following lines:

require "minitest/reporters" Minitest::Reporters.use!
like image 25
winterwolff Avatar answered Oct 20 '22 03:10

winterwolff