4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails test が機能しない時に取った対処法 cannot load such file -- minitest/reporters (LoadError)

Posted at

初心者がRails Tutorialの4章で遭遇したエラーについてお話します。

4.1.2のカスタムヘルパーの項のリスト 4.4「Homeページのタイトル確認用にテストを更新する」という場面で更新を行いました。その後rails testの指示があったのでその通り入力しましたが、テストが実行されず、以下のエラーが出てしまいました。

mac-no-MacBookPro:sample_app mac$ rails test
Starting sample_app_db_1 ... done
2019-04-19 09:02:17 WARN Selenium [DEPRECATION] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.
Running via Spring preloader in process 22
2019-04-19 09:02:25 WARN Selenium [DEPRECATION] Selenium::WebDriver::Chrome#driver_path= is deprecated. Use Selenium::WebDriver::Chrome::Service#driver_path= instead.
/app/db/schema.rb doesn't exist yet. Run `rails db:migrate` to create it, then try again. If you do not intend to use a database, you should instead alter /app/config/application.rb to limit the frameworks that will be loaded.


/usr/local/bundle/gems/bootsnap-1.4.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': cannot load such file -- minitest/reporters (LoadError)

rails db:migrateの入力が要求されますが、入力しても rails test後のエラー表示が消えませんでした。

下の文章で「cannot load such file -- minitest/reporters」と記述され、minitestがロードされていないことが分かります。

そこで、以下の文をGemfileに書き加えました。

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

書き込みが終わった後、インストールすることで解決しました。

$ bundle install --without production
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?