just print the error, but don't give specific advice

master
Brent Cook 2019-03-15 07:18:48 -05:00
parent 3027df6ab3
commit 180c395aa3
1 changed files with 5 additions and 15 deletions

View File

@ -1,6 +1,5 @@
require 'pathname' require 'pathname'
require 'rubygems' require 'rubygems'
require 'scanf'
GEMFILE_EXTENSIONS = [ GEMFILE_EXTENSIONS = [
'.local', '.local',
@ -26,20 +25,11 @@ end
begin begin
require 'bundler/setup' require 'bundler/setup'
rescue LoadError => e rescue LoadError => e
msg = e.to_s $stderr.puts "[*] Bundler failed to load and returned this error:"
ver = msg.scanf("You have already activated bundler %d.%d.%d, but your Gemfile requires bundler %d.%d.%d.") $stderr.puts
if ver.length == 6 $stderr.puts " '#{e}'"
activated_ver = "#{ver[0]}.#{ver[1]}.#{ver[2]}" $stderr.puts
wanted_ver = "#{ver[3]}.#{ver[4]}.#{ver[5]}" $stderr.puts "[*] You may need to uninstall or upgrade bundler"
$stderr.puts "[*] Bundler #{activated_ver} conflicts with Ruby #{RUBY_VERSION}'s default of #{wanted_ver}."
$stderr.puts
$stderr.puts " $ gem uninstall bundler -v #{activated_ver}"
else
$stderr.puts "[*] Bundler failed to load: '#{e}'"
$stderr.puts "[*] Metasploit requires the Bundler gem to be installed. You may need to run:"
$stderr.puts
$stderr.puts " $ gem install bundler"
end
exit(1) exit(1)
end end