If you attempt to deploy a new application to Heroku using Rails 4.0.0, with a default postgresql configuration in your gemfile, such as:
gem ‘pg’
Then, heroku will assume you are requesting PG version 0.12.2. This causes errors. Instead, to avoid connection errors (timeout, undefined constant, etc), you need a more recent version:
gem ‘pg’, ‘0.15.1’