Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verbose Output From rake assets:precompile

Tags:

I've just started using the asset_sync gem and my assets seem to be being compiled out of order, with Sass files unabled to access variables defined in other Sass files. What would really help me narrow down the issue is being able to see exactly what is going on during precompilation, but both rake assets:precompile and heroku run rake assets:precompile doesn't seem to offer a verbose option. All I get is some higher level output followed by a rake aborted! and a stack trace. Tailing heroku logs gets me nothing, so how can I get a more detailed log of what is going on during asset precompilation on Heroku?

like image 800
Undistraction Avatar asked Nov 13 '12 11:11

Undistraction


People also ask

What does rake assets Precompile do?

rake assets:precompile. We use rake assets:precompile to precompile our assets before pushing code to production. This command precompiles assets and places them under the public/assets directory in our Rails application.

How do you Precompile assets Rails in production?

To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.


1 Answers

Turns out a combination of the following gets you some more verbocity. You get output when a file is precompiled, but not as it is being precompiled, so if it hangs you can't see what it's choked on.

  1. Use the --trace flag

    $ heroku run rake assets:precompile --trace

  2. Set the log to use STDOUT in production.rb:

    config.logger = Logger.new(STDOUT)

like image 68
Undistraction Avatar answered Sep 21 '22 05:09

Undistraction