Skip to content

Commit

Permalink
inform user about bundler problem
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Dec 12, 2024
1 parent c7599c4 commit 26bf079
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Release 6.0.25 (Not yet released)
-------------
* [Standalone] Changes Passenger (not app) start and stop timeouts to 25s (from 15s) except for Nginx engine mode, which retains a stop timeout of 60s.
* [Ruby] Cause bundler version mismatch to output an intelligible error message. Closes GH-2567 and gh-2577.
*


Expand Down
11 changes: 11 additions & 0 deletions src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,17 @@ def run_load_path_setup_code(options)
#
# The existence of Gemfile/gems.rb indicates whether (2) is true:
elsif File.exist?('Gemfile') || File.exist?('gems.rb')
# Bundler 2.5.12+ throws a hissy fit if you don't have the
# version of bundler installed with which the Gemfile.lock was
# created. This causes extremely inscrutible error messages such
# as `/usr/bin/ruby doesn't exist`, so we cause RubyGems to raise
# an intelligible error here instead.
if File.exist?('Gemfile.lock')
lockfile_contents = File.read('Gemfile.lock').lines.map(&:strip)
index = lockfile_contents.index 'BUNDLED WITH'
bundler_version = lockfile_contents[index + 1] unless index.nil?
found = Gem::Specification.find_by_name('bundler', "= #{bundler_version}") unless bundler_version.nil?
end
# In case of Rails 3+, config/boot.rb already calls Bundler.setup.
# However older versions of Rails may not so loading boot.rb might
# not be the correct thing to do. To be on the safe side we
Expand Down

0 comments on commit 26bf079

Please sign in to comment.