Question

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.

Was it helpful?

Solution 2

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top