I had the following problem when deploying to production with capistrano

Capistrano postgresql: FATAL: Peer authentication failed for user

The fix was to add a host field under production for Postgres in config/database.yml

So if your database is on the same server then add:

host: localhost

If your database is on a different server then use:

host: yourDatabaseServerIP