title: Heroku Rails deploy fails with error "could not connect to server: Connection refused"
body: <p>Everything works fine locally, but I get that error when I try to push to heroku: </p>
  
  <blockquote>
    <p>Running: rake assets:precompile                                       </p>
  
  <pre><code>   Connecting to database specified by DATABASE_URL                                                                                                                                                          
     rake aborted!                                                                                                                                                                                             
     could not connect to server: Connection refused                                                                                                                                                           
     Is the server running on host "127.0.0.1" and accepting                                                                                                                                                   
     TCP/IP connections on port 5432?
  </code></pre>
    
    <p>/tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'                        </p>
  
  <pre><code>   /tmp/build_1903c764-07ce-4d06-aa45-6e78dec68af8/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
  </code></pre>
    
    <p>...
    etc</p>
  </blockquote>
  
  <p>I suspect it has to do something with database.yml, so here it is:</p>
  
  <pre><code>development:
    adapter: mysql2
    encoding: utf8
    database: dev-db
    pool: 5
    timeout: 5000
    socket: /tmp/mysql.sock
  
  test:
    adapter: mysql2
    encoding: utf8
    database: test-db
    pool: 5
    timeout: 5000
    socket: /tmp/mysql.sock
  
  production:
    adapter:  postgresql
    encoding: utf8
    database: prod-db
    pool: 5
    timeout: 5000
   # socket: /tmp/mysql.sock
  </code></pre>