ruby/rubygems · error · Gem::InstallError

#{command_name || class_name} failed#{error.message}

Error message

#{command_name || class_name} failed#{error.message}

What it means

Error "#{command_name || class_name} failed#{error.message}" thrown in ruby/rubygems.

Source

Thrown at lib/rubygems/ext/builder.rb:122

      build_env = { "SOURCE_DATE_EPOCH" => Gem.source_date_epoch_string }.merge(env)
      # A single-element command would be parsed as a shell command line,
      # splitting an unquoted command path containing spaces. Use the
      # [cmdname, argv0] form to keep exec semantics.
      command = [[command.first, command.first]] if command.size == 1
      output, status = begin
                         Open3.popen2e(build_env, *command, chdir: dir) do |stdin, stdouterr, wait_thread|
                           stdin.close
                           output = String.new
                           while line = stdouterr.gets
                             output << line
                             if verbose
                               print line
                             end
                           end
                           [output, wait_thread.value]
                         end
                       rescue StandardError => error
                         raise Gem::InstallError, "#{command_name || class_name} failed#{error.message}"
                       end
      unless verbose
        results << output
      end
    ensure
      ENV["RUBYGEMS_GEMDEPS"] = rubygems_gemdeps
    end

    unless status.success?
      results << "Building has failed. See above output for more information on the failure." if verbose
    end

    yield(status, results) if block_given?

    unless status.success?
      exit_reason =
        if status.exited?
          ", exit code #{status.exitstatus}"

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/rubygems/ext/builder.rb:122 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/f5ff21caf1407232. Report an issue: GitHub.