Ruby on Rails: heroku run rake assets:precompile

后端 未结 4 2107
青春惊慌失措
青春惊慌失措 2020-12-29 10:46

Please help me understand what heroku run rake assets:precompile exactly does. Ever since I began working on ruby on rails, I would always run these three comma

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 11:33

    For anyone having trouble figuring out why Heroku won't compile your assets automatically:

    If a public/assets/manifest.yml is detected in your app, Heroku will assume you are handling asset compilation yourself and will not attempt to compile your assets. Rails 4 uses a file called public/assets/manifest-.json instead. On both versions you can generate this file by running $ rake assets:precompile locally and checking the resultant files into Git.

    I found a sprockets-manifest-*.json and Heroku started compiling my assets automatically after I deleted this file.

    In my case, this file was generated by the script rails_composer.

提交回复
热议问题