{"record":{"id":"74564a94f6b0cf8a","repo":"ruby/rubygems","slug":"invalid-argument-arch-inspect","errorCode":null,"errorMessage":"invalid argument #{arch.inspect}","messagePattern":"invalid argument #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/platform.rb","lineNumber":126,"sourceCode":"                      when /(mswin\\d+)(?:[_-](\\d+))?/ then\n                        os = $1\n                        version = $2\n                        @cpu = \"x86\" if @cpu.nil? && os.end_with?(\"32\")\n                        [os, version]\n                      when /netbsdelf/ then                  [\"netbsdelf\", nil]\n                      when /openbsd-?(\\d+\\.\\d+)?/ then       [\"openbsd\",   $1]\n                      when /solaris-?(\\d+\\.\\d+)?/ then       [\"solaris\",   $1]\n                      when /wasi/ then                       [\"wasi\",      nil]\n                      # test\n                      when /^(\\w+_platform)-?(\\d+)?/ then    [$1,          $2]\n                      else [\"unknown\", nil]\n      end\n    when Gem::Platform then\n      @cpu = arch.cpu\n      @os = arch.os\n      @version = arch.version\n    else\n      raise ArgumentError, \"invalid argument #{arch.inspect}\"\n    end\n  end\n\n  def to_a\n    [@cpu, @os, @version]\n  end\n\n  def to_s\n    to_a.compact.join(@cpu.nil? ? \"\" : \"-\")\n  end\n\n  ##\n  # Deconstructs the platform into an array for pattern matching.\n  # Returns [cpu, os, version].\n  #\n  #   Gem::Platform.new(\"x86_64-linux\").deconstruct  #=> [\"x86_64\", \"linux\", nil]\n  #\n  # This enables array pattern matching:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/platform.rb#L108-L144","documentation":"Error \"invalid argument #{arch.inspect}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/platform.rb:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid architecture string (e.g. 'x86_64-linux') or Gem::Platform object instead of the reported value"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}