Setting the RakeFileUtils.verbose_flag default to false #4858

wants to merge 3 commits into


None yet
2 participants

aia commented Feb 3, 2012

Running rake assets:precompile produces the following

rake assets:precompile
/Users/artem/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /Users/artem/.rvm/gems/ruby-1.9.3-p0@rails-edge/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

There is an extra line showing a command that I did not ask for. Looks harmless.

However, when running from Capistrano the result is the following:

cap deploy

  * 21:16:28 == Currently executing `deploy:assets:precompile'
  * executing "cd /home/rails/captest/releases/20120203051625 & & bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
    servers: [""]
    [] executing command
*** [err ::] /usr/bin/ruby /home/rails/captest/shared/bundle/ruby/1.9.1/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
*** [err ::] 


The output comes out on stderr and Capistrano and automations built on Capistrano treat it as an error.

This small annoyance was big enough for me to actually find out why rake assets:precompile produces stderr output in a deployment mode.

The cause of this is the following commit to rake:

By default FileUtilsExt.verbose_flag = DEFAULT = (not true/false/nil etc) which has the same effect as the default true.

Arguable, Rake's FileUtilsExt default verbose = on setting is there by design and it may be a reasonable default for Rake. However, verbose = on is not a reasonable default for Rails because of deployment tools that treat output on stderr as errors.

With the attached fix the behavior changes to the following:

$ rake assets:precompile
$ rake assets:precompile -v
/Users/artem/.rvm/rubies/ruby-1.9.3-p0/bin/ruby /Users/artem/.rvm/gems/ruby-1.9.3-p0@rails-edge/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets

jeremyf commented May 3, 2012

This did not merge cleanly; Master appears to have deleted actionpack/lib/sprockets/assets.rake


jeremyf commented May 4, 2012

@aia Since the target has moved, can you close the pull request?

@aia aia closed this May 4, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment