9
8

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 3 years have passed since last update.

[Rails] ActiveRecord::NoDatabaseError [Docker]

Last updated at Posted at 2019-02-24

※環境構築時に、間違ってDBを消してしまった結果

Rails DockderでActiveRecord::NoDatabaseErrorでた場合
DBが無いエラーなのでrailsコマンドで作成してからマイグレーションを実行してください。

commandline.tool
ActiveRecord::NoDatabaseError
commandline.tool
docker-compose exec web rails db:create
docker-compose exec web rails db:migrate

!!!!

もしコンテナが起動していない状態であれば、execの部分をrunに置き換えて実行してください。

commandline.tool
docker-compose run web rails db:create
docker-compose run web rails db:migrate
9
8
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
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?