Fix bootsnap warning when booting msfrpc service

This commit is contained in:
adfoster-r7 2023-08-02 17:35:11 +01:00
parent 69cebde238
commit 67770d5684
3 changed files with 4 additions and 4 deletions

View File

@ -91,8 +91,8 @@ begin
}
invalidate_bootsnap_cache!(bootsnap_config)
Bootsnap.setup(**bootsnap_config)
rescue
$stderr.puts 'Warning: Failed bootsnap cache setup'
rescue => e
$stderr.puts "Warning: Failed bootsnap cache setup - #{e.class} #{e} #{e.backtrace}"
begin
FileUtils.rm_rf(cache_dir, secure: true)
rescue

View File

@ -7,7 +7,7 @@ require 'pathname'
@framework_path = File.expand_path(File.dirname(__FILE__))
root = Pathname.new(@framework_path).expand_path
@framework_lib_path = root.join('lib')
$LOAD_PATH << @framework_lib_path unless $LOAD_PATH.include?(@framework_lib_path)
$LOAD_PATH << @framework_lib_path.to_path unless $LOAD_PATH.include?(@framework_lib_path)
require 'msfenv'

View File

@ -5,7 +5,7 @@ require 'pathname'
@framework_path = '.'
root = Pathname.new(@framework_path).expand_path
@framework_lib_path = root.join('lib')
$LOAD_PATH << @framework_lib_path unless $LOAD_PATH.include?(@framework_lib_path)
$LOAD_PATH << @framework_lib_path.to_path unless $LOAD_PATH.include?(@framework_lib_path)
require 'msfenv'