Question

in Rails 4 + thin, quiet_assets gem worked nicely.

once I added unicorn and ran it with foreman, assets have become noisy again.

Is there any solution to this?

Was it helpful?

Solution 2

I tested this under:

  • Ruby 2.1.0
  • Ruby on Rails 4.0.2
  • Unicorn 4.8.2
  • Heroku foreman 0.60.0

In Gemfile:

gem 'quiet_assets', :group => :development

When running foreman start, you're correct that assets are noisy in the terminal.

However, assets will be suppressed by tailing the development log:

$ tail -f log/development.log

OTHER TIPS

What you're seeing in the output is Unicorn logging to STDOUT when it receives and dispatches requests.

You can simply pipe both STDOUT and STDERR to /dev/null with the following modification, cleaning up the Foreman output to just show the Rails log output:

web: bundle exec unicorn -p 3000 > /dev/null 2>&1
rails: tail -f log/development.log

This allows you to start your applications with a foreman start and have the appropriate logs automatically displayed without clutter.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top