Heroku Assets Precompile

后端 未结 3 578
梦如初夏
梦如初夏 2021-01-07 01:01

Today I was working with an application I\'ve had running on Heroku for a few months now and in an attempt to get something working I ran in my development environment:

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-07 01:27

    I'm willing to bet a compiled version/filename inside of manifest.yml in the public/assets folder was out of date/wrong.

    If you've made changes to the flexslider.js file, you'll need to recompile with rake assets:precompile and push the updated version to github. I believe you can set the version of the assets inside of the manifest.yml file.

    Also, I believe you can run heroku run rake assets:clean or heroku run rake assets:precompile.

    I don't think it would be a good idea to precompile assets inside of heroku because of versioning and name conflicts/not stored in github.

    You can clean the assets in heroku and push the repo again, so you wouldn't need to precompile locally and push to github, unless there was indeed an issue in the local compilation.

    I'd also take a few minutes to read http://guides.rubyonrails.org/asset_pipeline.html

    Another possibility is your file name is having issues with sprockets. Why not use the development version of the flexslider.js, rename it to something slightly more convenient, and allow sprockets to do the minification.

提交回复
热议问题