# File lib/bundler.rb, line 194 def requires_sudo? return @requires_sudo if @checked_for_sudo path = bundle_path path = path.parent until path.exist? sudo_present = !(`which sudo` rescue '').empty? @checked_for_sudo = true @requires_sudo = settings.allow_sudo? && !File.writable?(path) && sudo_present end