I tried to edit my CSS which was working in production mode but after a made a few changes the fonts weren't loading. I did a hard reset on my git and rolled back to the previews commit. I'm wondering what the best way of editing sites in production is. Do I have to precompile assets everytime I make a change in my CSS? I did this and ended up having loads of issues. I also tried deleting the public/assets folder and then assets:precompile but nothing worked.
In Production Environment after editing the CSS the assets need to be precompiled. Run the following command to precompile the assets
RAILS_ENV=production bundle exec rake assets:precompile
please refer the following link for more information http://edgeguides.rubyonrails.org/asset_pipeline.html#in-production
As you are already running the Rails application in production u need to run
RAILS_ENV=production bundle exec rake assets:precompile
Dont forget to use RAILS_ENV=production. After precompiling Old Assets will be replaced by the new ones
You might also need to edit config/environments/production.rb file and modify as following
config.serve_static_assets = true
config.assets.compress = false
config.assets.compile = true
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.