Skip to content

Commit

Permalink
fix issue during "bundle install" with non-exact Ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ashkulz committed Jan 16, 2023
1 parent 944d301 commit 6b3e305
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/bootboot/ruby_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def specs
# during dependency resolution so that we can pretend the intended Ruby
# version is present, as well as when updating the lockfile itself.
ruby_version = Bundler::Definition.build(Bootboot::GEMFILE, nil, false).ruby_version
if ruby_version && !(requirement = Gem::Requirement.new(ruby_version.versions)).exact?
# when we don't have an exact requirement, but the currently running Ruby version
# satisfies the requirement then simply use it as-is -- else we get a failure!
ruby_version = nil if requirement.satisfied_by?(Bundler::RubyVersion.system.gem_version)
end
ruby_version ||= Bundler::RubyVersion.system
ruby_spec = Gem::Specification.new(ruby_spec_name, ruby_version.gem_version)
ruby_spec.source = self
Expand Down

0 comments on commit 6b3e305

Please sign in to comment.