FATAL: database "postgres" does not exist

[Mac OS X] I've never had any problem with PostGreSQL while using Linux. However, I started working with a MacBook and got the same error as you. So... Probably this is not the solution you were expecting for, but this one app solved all my headaches. I just wanted to share it with you guys.

http://postgresapp.com/


You've not said whether you actually have a postgres database, which is what the error is complaining about.

Presumably not, and this "rake" tool is connecting as user postgres to database postgres so it can create the new databases. Obviously it needs to connect as someone to do anything.

Do take the time to skim through the PostgreSQL manuals and understand how to enable/control logging. It'll serve you well in the long run. I'm guessing there is a debug/log setting for rake/rails too.