title: Postgres 9.3 could not connect to server
body: <p><p> Running into the a similar issue as that mentioned here <br> <a href="https://stackoverflow.com/questions/13410686/postgres-could-not-connect-to-server">Postgres could not connect to server</a>
  <p>I am trying to run rake db:create on a rails 4.1.4 project. I have tried everything mentioned in the previous post - any other suggestions are welcome.
  <p> Furthermore, after reinstalling postgres, I ran the command
  <code>brew info postgresql</code> and got this <code>Conflicts with: postgres-xc</code> (though I'm not sure if this is relevant). I'm running postgres 9.3.4<p></p>
  
  <p>Any help will be greatly appreciated...<p>Thanks!</p>
  
  <p><em>Update:</em> This is the exact error:</p>
  
  <p><code>could not connect to server: Socket operation on non-socket
      Is the server running locally and accepting
      connections on Unix domain socket "/tmp/.s.PGSQL.5432"?</code></p>
  
  <p>Things I've tried so far:<br>
  <code>brew uninstall postgresql</code><br>
  <code>brew update</code><br>
  <code>brew upgrade</code><br>
  <code>brew install postgresql</code><br>
  followed by the list of commands here <a href="http://www.postgresql.org/docs/9.3/static/server-start.html" rel="nofollow noreferrer">http://www.postgresql.org/docs/9.3/static/server-start.html</a><p>
  Finally, using the lunchy gem to start postgres worked - <a href="http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/" rel="nofollow noreferrer">http://www.moncefbelyamani.com/how-to-install-postgresql-on-a-mac-with-homebrew-and-lunchy/</a></p>