Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Resolver::Specification#install
install(options = {}) { |installer| ... }
lib/rubygems/resolver/specification.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/resolver/specification.rb, line 109
def install(options = {})
require_relative "../installer"
gem = download options
installer = Gem::Installer.at gem, options.merge(
content_address: (spec.content_address if Gem::ContentAddress.content_addressed?(spec, validate_ruby_abi: false))
)
yield installer if block_given?
@spec = installer.install
end
Installs this specification using the Gem::Installer options. The install method yields a Gem::Installer instance, which indicates the gem will be installed, or nil, which indicates the gem is already installed.
After installation spec is updated to point to the just-installed specification.