Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't deploy to Heroku because the server refused the connection

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)
like image 581
htaidirt Avatar asked Aug 29 '13 05:08

htaidirt


1 Answers

Include the following in your application.rb, above the Module Appname

config.assets.initialize_on_precompile = false

And read the Heroku Labs: user-env-compile Article

like image 148
Mini John Avatar answered Oct 10 '22 14:10

Mini John