FATAL: database "postgres" does not exist

A strange mistake. All help was appreciated.

Here is my 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:

When I create databases manually and try to use them, for example rake db:test:preare, I get the following error:

FATAL:  database "postgres" does not exist

When I try to delete the databases, I get the following errors:

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

If I try to create databases using rake db:create:all, I get the following errors:

app_development already exists
app_test already exists
app_production already exists

So it looks like my database.yml is ok. But for some reason, it is looking for a database called postgres when it is not what is in my .yml database.

Any help was appreciated.

EDIT:

Here is from the rake track:

{ "adapter" = > "postgresql", "encoding" = > "unicode", "database" = > "app_production", "pool" = > 5, "username" = > " ", "" = > nil}

+5
2

, postgres, .

, "rake" postgres postgres , . , , -, - .

, PostgreSQL , / . . , debug/log rake/rails .

+1

[Mac OS X] PostGreSQL Linux. , MacBook , . ... , , , . , .

http://postgresapp.com/

+3

All Articles