End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Gem::Resolver::InstallerSet#add_always_install
add_always_install(dependency)
lib/rubygems/resolver/installer_set.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/rubygems/resolver/installer_set.rb, line 58
def add_always_install(dependency)
request = Gem::Resolver::DependencyRequest.new dependency, nil
found = find_all request
found.delete_if do |s|
s.version.prerelease? and not s.local?
end unless dependency.prerelease?
found = found.select do |s|
Gem::Source::SpecificFile === s.source or
Gem::Platform::RUBY == s.platform or
Gem::Platform.local === s.platform
end
found = found.sort_by do |s|
[s.version, s.platform == Gem::Platform::RUBY ? -1 : 1]
end
newest = found.last
unless @force
found_matching_metadata = found.reverse.find do |spec|
metadata_satisfied?(spec)
end
if found_matching_metadata.nil?
if newest
ensure_required_ruby_version_met(newest.spec)
ensure_required_rubygems_version_met(newest.spec)
else
exc = Gem::UnsatisfiableDependencyError.new request
exc.errors = errors
raise exc
end
else
newest = found_matching_metadata
end
end
@always_install << newest.spec
end
Looks up the latest specification for dependency and adds it to the always_install list.