I was getting a little overwhelmed by the amount of messages regarding each asset in my development logs, so I wanted to make my logs less verbose. It was making it more challenging to find the real actions and queries I was trying to analyze.
I found the answer in this post on Stack Overflow.
For some people, adding the initializer code worked, but for me, I went with adding:
config.assets.debug = false
and that was sufficient for me. I’m using Rails 3.1 and I noticed different settings people used in 3.2, so it may also be different if you use 3.2.
Took some lumps moving to 3.1 on Heroku.
Here’s some lessons:
config.assets.initialize_on_precompile = false
this has to be set per Rails Guides and Heroku.
- run “bundle exec rake assets:precompile” locally before pushing to Heroku. I had a lot of stuff work locally, but when Heroku compiled it, it blew up. There were a lot of things that I needed to change in my CSS files, working through them one by one
- the precompile generated files i uploaded (for the asset
- I was getting some errors related to the Sass-rails gem even though it was included in my gemfile. Turns out I had to move it so that it was outside of this block “group :assets do” that I had it in
Most people who are not on Windows use RVM to manage their Ruby versions, but RVM doesn’t work for Windows. Instead there’s a great tool called Pik that does the thing. Pik allows you to switch between different Ruby versions you have on your PC. I needed this once I went to 1.9.2.
The Github page for Pik is here: https://github.com/vertiginous/pik
The Github page didn’t include a lot of details though. For more detailed instructions, I found this wonderful tutorial by Ben Hall: