Disable Asset Minification in Rails Production

后端 未结 9 1891
Happy的楠姐
Happy的楠姐 2020-12-04 17:52

In order to debug javascript in my heroku production environment, I need to disable asset compression (or at least compression of javascript). I tried config.assets.c

相关标签:
9条回答
  • 2020-12-04 18:33

    Looks like this MAY have been a bug in Rails. From the changelog for upcoming rails 3.2.9, is this what you were running into?

    Respect config.digest = false for asset_path

    Previously, the asset_path internals only respected the :digest option, but ignored the global config setting. This meant that config.digest = false could not be used in conjunction with config.compile = false this corrects the behavior.

    http://weblog.rubyonrails.org/2012/10/29/ann-rails-3-2-9-rc1-has-been-released/

    Do you think that could be related?

    0 讨论(0)
  • 2020-12-04 18:36

    I had to update Rails.application.config.assets.version in config/initializers/assets.rb for the production.rb changes to take effect.

    0 讨论(0)
  • 2020-12-04 18:40

    Under Rails 4 just commenting out the line

    # config.assets.js_compressor = :uglifier
    

    in config/environments/production.rb worked for me. Looks like default is no compresson.

    0 讨论(0)
提交回复
热议问题