Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Gem.install

(::String name, ?::Gem::Requirement version, *::Gem::DependencyInstaller::options options) -> ::Array[::Gem::Specification]
install(name, version = Gem::Requirement.default, *options)

Top level install helper method. Allows you to install gems interactively:

% irb
>> Gem.install "minitest"
Fetching: minitest-5.14.0.gem (100%)
=> [#<Gem::Specification:0x1013b4528 @name="minitest", ...>]