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::Package.build

build(spec, skip_validation = false, strict_validation = false, file_name = nil, content_addressable: false)

Builds the gem described by spec and returns the built file name.

When content_addressable is true, builds a gem named by the SHA-256 digest of its contents. The spec must declare a non-Ruby platform and a required_ruby_version identifying a single Ruby ABI. Its required_rubygems_version is constrained to at least MINIMUM_RUBYGEMS_VERSION. Content-addressable builds are incompatible with file_name.

See also #build .new .raw_spec also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0