How can I completely disable asset compilation in a rails application on Heroku?

I have a rails application that starts a service that has no assets. When I deploy, I see:

-----> Preparing app for Rails asset pipeline Running: rake assets:precompile 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_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize' /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new' /tmp/build_3pneyggcg60ks/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect' ... 

So, I put this in my .rb application:

 config.assets.enabled = false config.serve_static_assets = false config.assets.compile = false 

But I still get the same message on deployment.

How can I completely disable compilation / asset handling on heroku?

+4
source share
2 answers

See this question and documents . It seems like magic is happening in the manifest.yml file.

+3
source

This is discovered at https://devcenter.heroku.com/articles/rails-asset-pipeline

When precompiling assets in Rails 3.x, you can prevent the initialization of your application and connection to the database, ensuring that the following line is in your config/application.rb :

 config.assets.initialize_on_precompile = false 
+2
source

Source: https://habr.com/ru/post/1493319/


All Articles