diff --git a/CHANGELOG.md b/CHANGELOG.md index ca58cda..96d5a6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +* Allow using bootsnap without bundler. See #488. * Fix startup failure if the cache directory points to a broken symlink. # 1.18.3 diff --git a/lib/bootsnap/explicit_require.rb b/lib/bootsnap/explicit_require.rb index 29ce5a4..4a46bee 100644 --- a/lib/bootsnap/explicit_require.rb +++ b/lib/bootsnap/explicit_require.rb @@ -25,6 +25,11 @@ def self.from_archdir(feature) # This is useful before bootsnap is fully-initialized to load gems that it # depends on, without forcing full LOAD_PATH traversals. def self.with_gems(*gems) + # Ensure the gems are activated (their paths are in $LOAD_PATH) + gems.each do |gem_name| + gem gem_name + end + orig = $LOAD_PATH.dup $LOAD_PATH.clear gems.each do |gem|