Make server work with Postgres.app

I'm using Postgres.app for my Postgres server, and running "rails s" would give the error:

PG::ConnectionBad (could not connect to server: No such file or directory
	Is the server running locally and accepting
	connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

Adding "host: localhost" in database.yml fixes this.