奇妙なエラー。すべての助けに感謝します。
これが私のdatabase.ymlです
development:
adapter: postgresql
encoding: unicode
database: app_development
pool: 5
username: username
password:
test:
adapter: postgresql
encoding: unicode
database: app_test
pool: 5
username: username
password:
production:
adapter: postgresql
encoding: unicode
database: app_production
pool: 5
username: username
password:
データベースを手動で作成して使用しようとすると、たとえばrake db:test:preare
、次のエラーが発生します。
FATAL: database "postgres" does not exist
データベースを削除しようとすると、次のエラーが発生します。
Couldn't drop app_development : #<PG::Error: FATAL: database "postgres" does not exist
>
Couldn't drop app_test : #<PG::Error: FATAL: database "postgres" does not exist
>
Couldn't drop app_production : #<PG::Error: FATAL: database "postgres" does not exist
を使用してデータベースを作成しようとするとrake db:create:all
、次のエラーが発生します。
app_development already exists
app_test already exists
app_production already exists
したがって、私のdatabase.ymlは問題ないようです。しかし、何らかの理由で、私のdatabase.ymlにない場合は、postgresというデータベースを探しています。
助けていただければ幸いです。
編集:
熊手の痕跡からの詳細は次のとおりです。
{"adapter" => "postgresql"、 "encoding" => "unicode"、 "database" => "app_production"、 "pool" => 5、 "username" => "username"、のデータベースを作成できませんでした"password" => nil}