如何在Heroku上的Rails应用程序中完全关闭资产编译?

问题描述:

我有一个Rails应用程序,它运行一项没有资产的服务。当我部署时,我看到:

I have a rails app which runs a service which 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'
...

所以我把它放到我的application.rb中:

So I put this into my application.rb:

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

但部署时我仍然收到同样的信息。

But I still get the very same message when deploying.

如何完全关闭heroku上的资产编译/处理?

How can I completely turn off asset compilation/handling on heroku?

请参阅这个问题文档。它看起来像是出现在 manifest.yml 文件中的奇迹。

See this question and the docs. It looks like the magic occurs in the manifest.yml file.