cubranic/chef-homebrew — pull request #1 by cubranic (2014-02-28 23:54:21+00:00)
Title: Run 'brew' via 'sudo' to force a clean environment

If the user runs Chef via Bundler, it executes in a modified
environment, which forces Ruby subproceses to look for gems
only in Bundler-controlled locations. This makes 'brew'
fail because it is run with Ruby 1.8, while the gems were
installed by the system Ruby (2.0 on Mavericks). By running
'brew' with a 'sudo -u', we'll get a clean environment and
let Ruby 1.8 run without any interference from Bundler.