kitchenplan/chef-homebrewalt — pull request #1 by cubranic (2014-03-01 00:00:51+00:00)
Title: Run 'brew' via 'sudo' to force a clean environment

If the user runs Chef via Bundler, as in the older Kitchenplan, it will execute in a modified environment, which forces Ruby subproceses to look for gemsonly in Bundler-controlled locations. This makes running 'brew' fail because it is shebang-ed to 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.