title: Having a lot of trouble connecting to Cloud SQL Postgres in rails
body: <p>I have configured by <code>database.yml</code> file according to this <a href="https://codelabs.developers.google.com/codelabs/cloud-ruby-on-rails-cloud-sql-postgres-ruby/index.html?index=..%2F..%2Findex#9" rel="nofollow noreferrer">guide</a> but it always comes back the error:</p>
  
  <p><strong>Error in Compute Engine</strong></p>
  
  <blockquote>
    <p>PG::ConnectionBad: could not connect to server: No such file or directory
            Is the server running locally and accepting
            connections on Unix domain socket "/cloudsql/[YOUR_INSTANCE_CONNECTION_NAME]/.s.PGSQL.5432"?</p>
  </blockquote>
  
  <p>I have whitelisted the network of <code>0.0.0.0/0</code> and also tried this <a href="https://cloud.google.com/sql/docs/postgres/connect-compute-engine" rel="nofollow noreferrer">guide</a> where you install the cloud sql proxy, but still no luck.</p>
  
  <p><strong>database.yml</strong></p>
  
  <pre><code>production:
    adapter: postgresql
    encoding: unicode
    pool: 5
    timeout: 5000
    database: databse-name
    username: &lt;%= ENV['DATABASE_USERNAME'] %&gt;
    password: &lt;%= ENV['DATABASE_PASSWORD'] %&gt;
    database: &lt;%= ENV['DATABASE'] %&gt;
    host: &lt;%= ENV['DATABASE_HOST'] %&gt;
    sslca: config/ssl/server-ca.pem
    sslcert: config/ssl/client-cert.pem
    sslkey: config/ssl/client-key.pem
  </code></pre>