diff --git a/lib/bundler.rb b/lib/bundler.rb index 15787d4ab48..0d538b761f7 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -196,7 +196,7 @@ def requires_sudo? path = bundle_path path = path.parent until path.exist? - sudo_present = !(`which sudo 2>#{NULL}` rescue '').empty? + sudo_present = !(`which sudo 2>&1 >#{NULL}` rescue '').empty? @checked_for_sudo = true @requires_sudo = settings.allow_sudo? && !File.writable?(path) && sudo_present diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 4ed9fdb64a1..54085a4ca8b 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -503,7 +503,7 @@ def self.source_root private def have_groff? - system("which groff 2>#{NULL}") rescue false + system("which groff 2>&1 >#{NULL}") rescue false end def locate_gem(name)