diff --git a/Library/Homebrew/formula_info.rb b/Library/Homebrew/formula_info.rb index 42a81bf8a5..75013a40c1 100644 --- a/Library/Homebrew/formula_info.rb +++ b/Library/Homebrew/formula_info.rb @@ -13,7 +13,15 @@ class FormulaInfo # Looks up formula on disk and reads its info. # Returns nil if formula is absent or if there was an error reading it. def self.lookup(name) - json = Utils.popen_read(HOMEBREW_BREW_FILE, "info", "--json=v1", name) + json = Utils.popen_read( + RUBY_PATH, + "-W0", + "-I", $LOAD_PATH.join(File::PATH_SEPARATOR), + HOMEBREW_LIBRARY_PATH/"brew.rb", + "info", + "--json=v1", + name + ) return unless $CHILD_STATUS.success?