There's an issue with Rails 4 and Postgres Adapter:
'could not obtain a database connection within 5.000 seconds (waited 5.000 seconds)'
https://github.com/rails/rails/issues/12867