【问题标题】:Rebuild JavaScript file which uses Ruby constant via Asset Pipeline通过 Asset Pipeline 重建使用 Ruby 常量的 JavaScript 文件
【发布时间】:2016-11-08 17:25:40
【问题描述】:

如何强制 Heroku 通过 Asset Pipeline 的链式扩展功能(例如 my-file.js.coffee.erb)重建使用 Ruby 常量的 JavaScript 文件,而不更改文件并重新部署?

我已更改 Heroku 环境变量并运行 heroku run rake assets:precompile,但文件仍未使用更新后的常量。 (该常量使用所述环境变量在初始化程序中设置。)

【问题讨论】:

    标签: ruby-on-rails heroku asset-pipeline


    【解决方案1】:

    https://help.heroku.com/18PI5RSY/how-do-i-clear-the-build-cache

    $ heroku plugins:install heroku-repo
    $ heroku repo:purge_cache -a appname
    $ git commit --allow-empty -m "Purge cache"
    $ git push heroku master
    

    其中 appname 替换为您要为其清除缓存的应用的名称。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-27
      • 2015-03-15
      • 2011-12-18
      • 1970-01-01
      • 2014-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多