I wanted to deploy my local Rails app (that works perfectly) to Heroku, but get the following error message:
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?
/tmp/build_21pkcz898c28o/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
Followed by many lines about postgres_adapter
.
I'm a bit disappointed because I red that Heroku overwrite config/database.yml so why does it talk about running the server on 127.0.0.1
(I'm not looking for remote db)?
Thanks,
Update
If this can help, running heroku config
gives the following:
DATABASE_URL: xxx
HEROKU_POSTGRESQL_GRAY_URL: xxx (the same xxx as above)
Include the following in your application.rb, above the Module Appname
And read the Heroku Labs: user-env-compile Article
I am using Rails 4.0.4 and none of the above worked for me.
Following the heroku documentation
then
Resolved it partially for me ... I could 'git push heroku master' but then my Bootstrap styling is not applied.
To resolve this final part, I added the recommended 'rails_12factor' gem in my gemfile.
And all worked fine after that after my git push