rails6上でminitestの導入がしたいのですが、導入後$ rails testを実行するとエラーが発生してしまいます。
gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '3.0.2' 5 6gem 'rails', '~> 6.1.4', '>= 6.1.4.1' 7 8gem 'puma', '~> 5.0' 9 10gem 'sass-rails', '>= 6' 11 12gem 'webpacker', '~> 5.0' 13 14gem 'turbolinks', '~> 5' 15 16gem 'bootsnap', '>= 1.4.4', require: false 17 18group :development, :test do 19 20 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 21 gem 'sqlite3', '1.4.2' 22end 23 24group :development do 25 26 gem 'web-console', '>= 4.1.0' 27 28 gem 'rack-mini-profiler', '~> 2.0' 29 gem 'listen', '~> 3.3' 30 31 gem 'spring' 32end 33 34group :test do 35 36 gem 'capybara', '>= 3.26' 37 gem 'selenium-webdriver' 38 39 gem 'webdrivers' 40 gem 'minitest', '5.14.4' 41end 42 43group :test do 44 gem 'pg', '1.2.3' 45end 46 47gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 48
ERROR
1name@nameMacBook-Air gymoha % rails t 2Running via Spring preloader in process 58573 3/Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:34:in `require': cannot load such file -- minitest/reporters (LoadError) 4 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' 5 from /Users/name/name/gymoha/test/test_helper.rb:4:in `<main>' 6 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 7 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 8 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 9 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 10 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 11 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' 12 from /Users/name/name/gymoha/test/channels/application_cable/connection_test.rb:1:in `<main>' 13 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 14 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 15 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 16 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 17 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 18 from /Users/name.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' 19 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/test_unit/runner.rb:50:in `block in load_tests' 20 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/test_unit/runner.rb:50:in `each' 21 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/test_unit/runner.rb:50:in `load_tests' 22 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/test_unit/runner.rb:39:in `run' 23 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/commands/test/test_command.rb:33:in `perform' 24 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run' 25 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command' 26 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch' 27 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/command/base.rb:69:in `perform' 28 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/command.rb:48:in `invoke' 29 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/railties-6.1.4.1/lib/rails/commands.rb:18:in `<main>' 30 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require' 31 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi' 32 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register' 33 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi' 34 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require' 35 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require' 36 from /Users/name/name/gymoha/bin/rails:5:in `<main>' 37 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load' 38 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bootsnap-1.9.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load' 39 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:10:in `block in fork' 40 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:10:in `block in fork' 41 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:8:in `fork' 42 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:8:in `fork' 43 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:27:in `fork' 44 from /Users/name/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:8:in `fork' 45 from /Users/name.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/activesupport-6.1.4.1/lib/active_support/fork_tracker.rb:27:in `fork' 46 from <internal:/Users/name/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' 47 from <internal:/Users/name/.rbenv/versions/3.0.2/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require' 48 from -e:1:in `<main>'
test_helper.rb
test_helper.rb
1 2ENV['RAILS_ENV'] ||= 'test' 3require_relative "../config/environment" 4require "rails/test_help" 5require "minitest/reporters" 6Minitest::Reporters.use! 7 8class ActiveSupport::TestCase 9 # 特定のワーカーではテストをパラレル実行する 10 parallelize(workers: :number_of_processors) 11 12 # 全てのテストがアルファベット順に実行されるよう、 13 # test/fixture/*.ymlにある全てのfixtureをセットアップする 14 fixtures :all 15 16 # (全てのテストで使うその他のヘルパーメソッドは省略 17end 18
以上のファイルでコードに誤りがあると思われるのですが、、、
お分かりになる方、アドバイスを頂けると幸いです。
よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2021/10/19 13:11
2021/10/19 14:31
退会済みユーザー
2021/10/25 23:48