Reputation: 9499
I am pushing to an app I haven't updated in months and am running into this problem. I only changed a few variables in my code. No idea why its suddenly doing this to me.
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
To [email protected]:myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:myapp.git'
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_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/model_schema.rb:308:in `clear_cache!'
/tmp/build_8c6e6263-c5c9-44ac-88ad-7eadb7c4c0e6/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/railtie.rb:104:in `block (2 levels) in <class:Railtie>'
Upvotes: 0
Views: 4560
Reputation: 5721
The most common reasons for asset recompilation issues can be found here on the heroku support page.
Based on the mention of Postgres in the error message, I would try changing the following line in your config/application.rb to false like so: config.assets.initialize_on_precompile = false
.
Upvotes: 2
Reputation: 3669
You should prevent initializing your application and connecting to the database by ensuring that the following line is in your config/application.rb:
config.assets.initialize_on_precompile = false
Upvotes: 1