LoginSignup
0
0

More than 1 year has passed since last update.

rake db:create で ActiveRecord::NoDatabaseError

Posted at

Rails 環境の構築中に、rake db:create で以下のエラーが発生。

ActiveRecord::NoDatabaseError: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

ググると .pid ファイル消すといいとかって記事が色々ヒットするけど、全然なおらない。

2h くらい引っかかっていた時、さっきまで動いてた別のブランチで、同じ手順で構築し直して rake db:create するとなぜか動く。

作業していたファイルの差分を見ると・・・、

 default: &default
   adapter: postgresql
   encoding: unicode
-  host: db
-  username: postgres
-  password: password
-  pool: 5

そりゃ動かないよね。凡ミス。

おしまい。

0
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
0
0