質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

4166閲覧

rails testを実行したらハマってしまった

oden_kun

総合スコア8

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2018/05/02 01:11

前提・実現したいこと

Rub on Railsのチュートリアルの4章をやっています
rails testを実行したい

rails testを実行しようとしたらエラーメッセージが表示された
googleで調べたけど何を直せばいいかわからない
herokuにアップしてからrails testができなくなった気がする

発生している問題・エラーメッセージ

rails testしようとしたらこう表示されました。

Running via Spring preloader in process 15611 /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': cannot load such file -- minitest/reporters (LoadError) from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require' from /Users/yuzi/rails/sample_app/test/test_helper.rb:4:in `<main>' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require' from /Users/yuzi/rails/sample_app/test/controllers/static_pages_controller_test.rb:1:in `<main>' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/test_unit/runner.rb:50:in `block in load_tests' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/test_unit/runner.rb:50:in `each' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/test_unit/runner.rb:50:in `load_tests' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/test_unit/runner.rb:39:in `run' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/commands/test/test_command.rb:33:in `perform' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command' from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/command/base.rb:65:in `perform' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/command.rb:46:in `invoke' from /Library/Ruby/Gems/2.3.0/gems/railties-5.2.0/lib/rails/commands.rb:18:in `<main>' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `block in require' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:283:in `require' from /Users/yuzi/rails/sample_app/bin/rails:9:in `<main>' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load' from /Library/Ruby/Gems/2.3.0/gems/bootsnap-1.3.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:50:in `load' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `block in load' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:249:in `load_dependency' from /Library/Ruby/Gems/2.3.0/gems/activesupport-5.2.0/lib/active_support/dependencies.rb:277:in `load' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from -e:1:in `<main>'

試したこと

rails db:migrate
最初にエラーメッセージがでたとき、

rails db:migration

をやれとターミナルに表示されて試してみたが、結局rails testはできず

Gemfileの内容をherokuにアップするために

group :production do gem 'pg' end group :development, :test do gem 'sqlite3' end

と変更したせいだろうか

補足情報(FW/ツールのバージョンなど)

Ruby on Rails 5.2

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

エラーメッセージが cannot load such file -- minitest/reporters (LoadError) なので、Gemfileにライブラリ設定が無いことが原因の可能性が高いです。

Railsチュートリアルでminitestを検索してみたら「3.6.1 minitest reporters」があり、「リスト 3.2: サンプルアプリケーション用のGemfile」でminitest-reportersを追加しているとの説明がありました。

Gemfileの内容を、質問欄の最後に記入している内容だけに変更したらプログラムは動かないです。

投稿2018/05/02 03:37

tkmtmkt

総合スコア1800

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問