Heroku does not precompile assets when deploying

后端 未结 4 1655
旧巷少年郎
旧巷少年郎 2021-02-03 16:12

It very clearly says in its documentation that it would do this if I don\'t precompile them locally.

And truthfully, I have no interest in precompiling these locally.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-03 16:32

    Some things to check

    1. You're on Cedar, right? Heroku only supports this behavior on Cedar.
    2. You're on Rails 3, right? Heroku doesn't support precompiling assets on Rails 4.
    3. You have asset pipeline turned on, right? in config/application.rb you need the line config.assets.enabled = true
    4. You have to not have a public/assets folder. On deployment Heroku decides whether or not to precompile based on whether this folder is present (even if it's empty).
    5. If the pipeline is on and you don't have an assets folder, then pre-compilation must be failing.

提交回复
热议问题