Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Gem::Specification#activate_dependencies
activate_dependencies
lib/rubygems/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/rubygems/specification.rb, line 1467
def activate_dependencies
unresolved = Gem::Specification.unresolved_deps
runtime_dependencies.each do |spec_dep|
if loaded = Gem.loaded_specs[spec_dep.name]
next if spec_dep.matches_spec? loaded
msg = "can't satisfy '#{spec_dep}', already activated '#{loaded.full_name}'"
e = Gem::LoadError.new msg
e.name = spec_dep.name
raise e
end
begin
specs = spec_dep.to_specs
rescue Gem::MissingSpecError => e
raise Gem::MissingSpecError.new(e.name, e.requirement, "at: #{spec_file}")
end
if specs.size == 1
specs.first.activate
else
name = spec_dep.name
unresolved[name] = unresolved[name].merge spec_dep
end
end
unresolved.delete self.name
end
Activate all unambiguously resolved runtime dependencies of this spec. Add any ambiguous dependencies to the unresolved list to be resolved later, as needed.
See also
#activate
#add_bindir
#abbreviate
#add_dependency
also in
4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0