Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Installer#ensure_dependency
ensure_dependency(spec, dependency)
lib/rubygems/installer.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/installer.rb, line 382
def ensure_dependency(spec, dependency)
unless installation_satisfies_dependency? dependency
raise Gem::InstallError, "#{spec.name} requires #{dependency}"
end
true
end
Ensure that the dependency is satisfied by the current installation of gem. If it is not an exception is raised.
- spec
- dependency
See also
#dir
#ensure_loadable_spec
#default_spec_file
#explicit_version_requirement
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0