{"record":{"id":"60f9058092351f52","repo":"ruby/rubygems","slug":"uri-scheme-is-invalid-uri-scheme-inspect","errorCode":null,"errorMessage":"uri scheme is invalid: #{uri.scheme.inspect}","messagePattern":"uri scheme is invalid: #(.+?)","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/remote_fetcher.rb","lineNumber":259,"sourceCode":"      error_detail = custom_error || response.message\n      raise FetchError.new(\"Bad response #{error_detail} #{response.code}\", uri)\n    end\n  end\n\n  alias_method :fetch_https, :fetch_http\n\n  ##\n  # Downloads +uri+ and returns it as a String.\n\n  def fetch_path(uri, mtime = nil, head = false)\n    uri = Gem::Uri.new uri\n\n    method = {\n      \"http\" => \"fetch_http\",\n      \"https\" => \"fetch_http\",\n      \"s3\" => \"fetch_s3\",\n      \"file\" => \"fetch_file\",\n    }.fetch(uri.scheme) { raise ArgumentError, \"uri scheme is invalid: #{uri.scheme.inspect}\" }\n\n    data = send method, uri, mtime, head\n\n    if data && !head && uri.to_s.end_with?(\".gz\")\n      begin\n        data = Gem::Util.gunzip data\n      rescue Zlib::GzipFile::Error\n        raise FetchError.new(\"server did not return a valid file\", uri)\n      end\n    end\n\n    data\n  rescue Gem::Timeout::Error, IOError, SocketError, SystemCallError,\n         *(OpenSSL::SSL::SSLError if Gem::HAVE_OPENSSL) => e\n    raise FetchError.new(\"#{e.class}: #{e}\", uri)\n  end\n\n  def fetch_s3(uri, mtime = nil, head = false)","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/remote_fetcher.rb#L241-L277","documentation":"Error \"uri scheme is invalid: #{uri.scheme.inspect}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/remote_fetcher.rb:259 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the source URI to use a valid scheme (http:// or https://)"],"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"}