【问题标题】:How to disable assets compilation for certain environment?如何禁用特定环境的资产编译?
【发布时间】:2015-01-30 05:54:15
【问题描述】:

对于我的 Rails 3.2/Capistrano 3 应用程序,我配置了 2 个部署环境:stagingproduction

部署到staging时我不想花时间编译资产,因为它应该与本地development相同。

在我的Capfile 我有

require 'capistrano/rails/assets'

这是production 所需要的,但Capistrano 这一行还可以为所有其他环境编译资产。

如何配置它以编译特定环境的资产(或跳过编译)?

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 capistrano capistrano3


    【解决方案1】:

    尝试将此行添加到 config/environments/staging.rb 文件中

    config.assets.compile = false
    

    【讨论】:

    • 谢谢,这是我首先尝试的,即使使用它,capistrano 也会尝试运行以异常结束的预编译任务
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-02
    • 1970-01-01
    • 2014-07-04
    • 2015-04-16
    • 2015-12-14
    • 2017-11-22
    相关资源
    最近更新 更多