I reviewed the many posts on this topic but can’t seem to find the combination to fix my problem. Sorry if this is a repeat.
Problem is I’m not sure the sequence of steps I took to get to this point.
I had a perfectly functioning Rails app in both development and production on Heroku. However, on Heroku deploy, I was getting an error during the asset precompilation. So, I changed settings so Heroku would assume ‘rake asset:precompile’ had been run locally before deploy. Got rid of the deploy error, no problem. Somewhat annoying that I had to now precompile locally and include the files in my Git repository, but I liked the no-error deploy.
Anyway, now in development, changes to CSS weren’t being reflected on-the-fly. I’d have to run ‘rake assets:precomplile’. That’s no good. Found a post that deleting public/assets would fix that, which it did.
Now Javascript/Coffeescript changes don’t get reflected on-the-fly.
Sorry for the longwinded description.
Ideally, I’d get to a world where changes are reflected on-the-fly in development, I don’t need to run ‘rake assets:precomplile’ before Heroku deploy, and I don’t get an error during precompile on Heroku.
Less ideally, I’d just get back to my initial behavior (where Heroku complained on deploy, but everything still worked fine).
If you want to precompile the assets on the fly use (for example
config/production.erb)Then look in
config/application.rbthere you can choose if you want to precompile before deploying to production