title: Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
body: <p>Before anything, please note that I have found several similar questions on Stack Overflow and articles all over the web, but none of those helped me fix my issue:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/24333317/pg-error-could-not-connect-to-server-connection-refused-is-the-server-running-o">PG Error could not connect to server: Connection refused Is the server running on port 5432?</a></li>
  <li><a href="https://stackoverflow.com/questions/19828385/pgconnectionbad-could-not-connect-to-server-connection-refused">PG::ConnectionBad - could not connect to server: Connection refused</a></li>
  <li><a href="https://github.com/PostgresApp/PostgresApp/issues/37" rel="noreferrer">psql: could not connect to server: Connection refused</a></li>
  </ul>
  
  <p>Now, here is the issue:</p>
  
  <ul>
  <li>I have a Rails app that works like a charm.</li>
  <li>With my collaborator, we use GitHub to work together.</li>
  <li>We have a <code>master</code> and an <code>mvp</code> branches.</li>
  <li>I recently updated my <code>git</code> version with Homebrew (Mac).</li>
  <li>We use Foreman to start our app locally.</li>
  </ul>
  
  <p>Now, when I try to launch the app locally, I get the following error:</p>
  
  <pre><code>PG::ConnectionBad at /
  could not connect to server: Connection refused
      Is the server running on host "localhost" (::1) and accepting
      TCP/IP connections on port 5432?
  could not connect to server: Connection refused
      Is the server running on host "localhost" (127.0.0.1) and accepting
      TCP/IP connections on port 5432?
  </code></pre>
  
  <p>I tried to reboot my computers several times.</p>
  
  <p>I also checked the content of <code>/usr/local/var/postgres</code>:</p>
  
  <pre><code>PG_VERSION      pg_dynshmem     pg_multixact    pg_snapshots    pg_tblspc       postgresql.conf
  base            pg_hba.conf     pg_notify       pg_stat         pg_twophase     postmaster.opts
  global          pg_ident.conf   pg_replslot     pg_stat_tmp     pg_xlog         server.log
  pg_clog         pg_logical      pg_serial       pg_subtrans     postgresql.auto.conf
  </code></pre>
  
  <p>As you can see, there is no <code>postmaster.pid</code> file in there.</p>
  
  <p>Any idea how I could fix this?</p>