13
0

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 が RuntimeErrorで失敗する(Queue not empty, but all workers have finished.)

Posted at

RuntimeError発生

Rails6で rails test してみると下記のようなエラーが発生。

$ rails t
Running via Spring preloader in process 3232
Run options: --seed 48688

# Running:

/Users/amatsuki/programing/portfolio/study_roadmap/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 /Users/amatsuki/programing/portfolio/study_roadmap/config/application.rb to limit the frameworks that will be loaded.
/Users/amatsuki/programing/portfolio/study_roadmap/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 /Users/amatsuki/programing/portfolio/study_roadmap/config/application.rb to limit the frameworks that will be loaded.
Traceback (most recent call last):
        5: from -e:1:in `<main>'
        4: from /Users/amatsuki/.rbenv/versions/2.6.4/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        3: from /Users/amatsuki/.rbenv/versions/2.6.4/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        2: from /Users/amatsuki/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:63:in `block in autorun'
        1: from /Users/amatsuki/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/minitest-5.11.3/lib/minitest.rb:140:in `run'
/Users/amatsuki/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/activesupport-6.0.0/lib/active_support/testing/parallelization.rb:118:in `shutdown': Queue not empty, but all workers have finished. This probably means that a worker crashed and 5 tests were missed. (RuntimeError)

対処法

下記コマンドで解決。

rails db:migrate

エラー文の上の方を見てみると、
schema.rb がないので rails db:migrate して作ってねと書いてありました。

/Users/amatsuki/programing/portfolio/study_roadmap/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 /Users/amatsuki/programing/portfolio/study_roadmap/config/application.rb to limit the frameworks that will be loaded.
13
0
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
13
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?