PG::ConnectionBad: could not connect to server: No such file or directory

I posted a question on stackoverflow seeking help. I;ve been asking on the ruby on rails IRC channel as well. I'm not sure how to fix this issue. I am new to ruby on rails and I having a hard time getting postgres to work with my rails app. When I run rake db:create or rake db:migrate, I get these errors

could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Show us database.yml

Can you access the pg server using, for example, psql?

Colin