我一直在尝试修复错误但总是让Rake中止!
Load Error: cannot load such file -- minitest/reporters
运行以下命令时出现相同的错误:
bundle exec rake test
我是这里的新蜜蜂,非常感谢你的帮助。
changeme-mac-2:sample_app1 tshrestha$ rails -v
Rails 4.1.7
changeme-mac-2:sample_app1 tshrestha$ rake test
rake aborted!
LoadError: cannot load such file -- minitest/reporters
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/Desktop/workspace/sample_app1/test/test_helper.rb:4:in `<top (required)>'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/Desktop/workspace/sample_app1/test/helpers/application_helper_test.rb:1:in `<top (required)>'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:114:in `block (3 levels) in define'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:114:in `each'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:114:in `block (2 levels) in define'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:113:in `each'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:113:in `block in define'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/sub_test_task.rb:20:in `invoke_rake_task'
/Users/tshrestha/.rvm/gems/ruby-2.1.3@global/gems/railties-4.1.7/lib/rails/test_unit/testing.rake:8:in `block in <top (required)>'
/Users/tshrestha/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
/Users/tshrestha/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => test:run => test:units
(See full trace by running task with --trace)
changeme-mac-2:sample_app1 tshrestha$ bundler -v
Bundler version 1.7.6
changeme-mac-2:sample_app1 tshrestha$ ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]"
这是我的Gemfile,包含以下宝石。
gem 'rails', '4.1.7'
gem "minitest", '5.4.3'
gem 'bootstrap-sass', '3.2.0.0'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
# gem 'bcrypt', '~> 3.1.7'
# gem 'unicorn'
# gem 'capistrano-rails', group: :development
# gem 'debugger', group: [:development, :test]
答案 0 :(得分:6)
minitest-reporters
是Minitest的独立宝石。您应该将以下内容添加到您的Gemfile中:
group :test do
gem 'minitest-reporters'
end
重新运行捆绑包,它应该可以解决您的问题。