Skip to content

Commit

Permalink
Merge pull request #489 from Shopify/fix-load-error
Browse files Browse the repository at this point in the history
Fix bootsnap setup in environments without bundler
  • Loading branch information
casperisfine authored Jul 17, 2024
2 parents c5513d9 + 7afa951 commit 407bdef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/bootsnap/explicit_require.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit 407bdef

Please sign in to comment.