Lately, I had this problem. Pretty annoying btw.
I was browsing internet and had several chrome tabs opened... Suddenly my mac crashed and frozen... I wait, but nothing happened, so I hard turned it off. The next day none of my rails applications were working.
I have postgres installed with brew. Started googling, and found this SO answer...
It basically says to remove the file
Basically since I shut my laptop down, postgres was not able of removing that file... on the next run postgres could not run.