ruby/rubygems · error · Gem::Exception

Failed to sign gem: #{out}

Error message

Failed to sign gem:

#{out}

What it means

Error "Failed to sign gem: #{out}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/commands/push_command.rb:166

  def attest!(name)
    require "open3"
    require "shellwords"
    require "tempfile"

    tempfile = Tempfile.new([File.basename(name, ".*"), ".sigstore.json"])
    bundle = tempfile.path
    tempfile.close(false)

    env = defined?(Bundler.unbundled_env) ? Bundler.unbundled_env : ENV.to_h
    # Gem.ruby is quoted if it contains whitespace, so split it into argv
    # elements to keep the quotes out of the spawned command.
    out, st = Open3.capture2e(
      env,
      *Shellwords.split(Gem.ruby), "-S", "gem", "exec", "--conservative",
      "sigstore-cli", "sign", name, "--bundle", bundle,
      unsetenv_others: true
    )
    raise Gem::Exception, "Failed to sign gem:\n\n#{out}" unless st.success?

    bundle
  end

  def get_hosts_for(name)
    gem_metadata = Gem::Package.new(name).spec.metadata

    [
      gem_metadata["default_gem_server"],
      gem_metadata["allowed_push_host"],
    ]
  end

  def get_push_scope
    :push_rubygem
  end

  def attestation_supported_host?

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/rubygems/commands/push_command.rb:166 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/f207ac6c41cfd0a3. Report an issue: GitHub.