{"record":{"id":"79e39158a649346d","repo":"ruby/rubygems","slug":"invalid-uri-scheme-for-value-preface-urls-with","errorCode":null,"errorMessage":"Invalid uri scheme for #{value}\nPreface URLs with one of [\"http://\", \"https://\", \"file://\", \"s3://\"]","messagePattern":"Invalid uri scheme for #(.+?)\nPreface URLs with one of \\[\"http://\", \"https://\", \"file://\", \"s3://\"\\]","errorType":"validation","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/local_remote_options.rb","lineNumber":30,"sourceCode":"##\n# Mixin methods for local and remote Gem::Command options.\n\nmodule Gem::LocalRemoteOptions\n  ##\n  # Allows Gem::OptionParser to handle HTTP URIs.\n\n  def accept_uri_http\n    Gem::OptionParser.accept Gem::URI::HTTP do |value|\n      begin\n        uri = Gem::URI.parse value\n      rescue Gem::URI::InvalidURIError\n        raise Gem::OptionParser::InvalidArgument, value\n      end\n\n      valid_uri_schemes = [\"http\", \"https\", \"file\", \"s3\"]\n      unless valid_uri_schemes.include?(uri.scheme)\n        msg = \"Invalid uri scheme for #{value}\\nPreface URLs with one of #{valid_uri_schemes.map {|s| \"#{s}://\" }}\"\n        raise ArgumentError, msg\n      end\n\n      value\n    end\n  end\n\n  ##\n  # Add local/remote options to the command line parser.\n\n  def add_local_remote_options\n    add_option(:\"Local/Remote\", \"-l\", \"--local\",\n               \"Restrict operations to the LOCAL domain\") do |_value, options|\n      options[:domain] = :local\n    end\n\n    add_option(:\"Local/Remote\", \"-r\", \"--remote\",\n      \"Restrict operations to the REMOTE domain\") do |_value, options|\n      options[:domain] = :remote","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/local_remote_options.rb#L12-L48","documentation":"Error \"Invalid uri scheme for #{value}\nPreface URLs with one of [\"http://\", \"https://\", \"file://\", \"s3://\"]\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/local_remote_options.rb:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Preface the URL with one of http://, https://, file://, or s3://"],"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"}