'Css changes are not being applied in rails app
I am working on rails app and now I am having trouble.
Early when I use to change my frontend styling and apply changes in css then they quickly show up on reload in brower.
But in present, don't know but something went wrong. Whenever I change css and save it then onload, things remain same. After debugging, I found that app is picking styling files from precompiled assets pipeline. So for the solution, I have to recompile the assets then 2 new files are generated against wach file changed. And there will be 4 files in total against a single css file in which changes are made. So now I have to delete old ones and then have to restart the serve and refreshing the browser will show all the changing and that is weird as I have to do it all the time for every single change. I can't figure as I am new to rails. Help....
Solution 1:[1]
Please clear the tmp cache first and then run the server
$ rake tmp:cache:clear && rails server
Solution 2:[2]
If you are developing the app, you should delete public/assets directory. Then restart the app. Don't run asssts:precompile task. Your most recent changes of assets will be up to date without restart the app.
Solution 3:[3]
I had the same issue and found a solution : run rake assets:clobber, it will remove the precompiled css and js. Then run yarn build --watch to build back the css and js file.
Dont run the assets:build as the same issue will revert.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vishal Pandey |
| Solution 2 | sam |
| Solution 3 | Cédric |
