如何在 heroku 上禁用资产管道?

问题描述 投票:0回答:2

heroku cedar 隐式预编译我的资产,即使我写了:

config.assets.enabled = false

如何禁用资产功能?

ruby-on-rails ruby-on-rails-3 heroku
2个回答
4
投票

问题是编译 slug 时应用程序配置不可用。最近通过 http://devcenter.heroku.com/articles/labs-user-env-compile 解决了这个问题,但我不确定这是否对这里有帮助。

有关 Heroku 管道的更多信息,请查看http://devcenter.heroku.com/articles/rails31_heroku_cedar

看起来防止资产编译的最简单方法是将文件放在 public/assets/manifest.yml 中——假设内容不相关,但也可以通过 config.assets.enabled 禁用它以防万一。


0
投票

我能让这个工作的唯一方法是在我的

Rakefile
中覆盖它们:

...

Rake::Task["assets:precompile"].clear
   namespace :assets do
     task 'precompile' do
     puts "Not pre-compiling assets..."
   end
end

Rake::Task["assets:clean"].clear
   namespace :assets do
     task 'clean' do
     puts "Not cleaning assets..."
   end
end
© www.soinside.com 2019 - 2024. All rights reserved.