Follow Along as I Stumble on the Path to Learning RoR

3.1

Making the Asset Pipeline Less Verbose

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

in config/enviroments/development.rb 

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.


Moving to 3.1 on Heroku

Took some lumps moving to 3.1 on Heroku.

Here’s some lessons:

  1. config.assets.initialize_on_precompile = false

    this has to be set per Rails Guides and Heroku.

  2. 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
  3. the precompile generated files i uploaded (for the asset
  4. I had a bunch of views with javascript_include_tag and the asset pipeline wasn’t fond of that so I moved it into my application.cs and .js files to use instead
  5. 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

Pik

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:
http://blog.benhall.me.uk/2010/08/installing-rails-30-ruby-192-and-pik-on.html