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