{"record":{"id":"a93fe26b3401bfe2","repo":"ruby/rubygems","slug":"invalid-gem-requirement-pattern-v","errorCode":null,"errorMessage":"Invalid gem requirement pattern '#{v}'","messagePattern":"Invalid gem requirement pattern '#(.+?)'","errorType":"exception","errorClass":"Bundler::InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/add.rb","lineNumber":58,"sourceCode":"\n    def validate_options!\n      raise InvalidOption, \"You cannot specify `--git` and `--github` at the same time.\" if options[\"git\"] && options[\"github\"]\n\n      unless options[\"git\"] || options[\"github\"]\n        raise InvalidOption, \"You cannot specify `--branch` unless `--git` or `--github` is specified.\" if options[\"branch\"]\n\n        raise InvalidOption, \"You cannot specify `--ref` unless `--git` or `--github` is specified.\" if options[\"ref\"]\n      end\n\n      raise InvalidOption, \"You cannot specify `--branch` and `--ref` at the same time.\" if options[\"branch\"] && options[\"ref\"]\n\n      raise InvalidOption, \"You cannot specify `--strict` and `--pessimistic` at the same time.\" if options[:strict] && options[:pessimistic]\n\n      # raise error when no gems are specified\n      raise InvalidOption, \"Please specify gems to add.\" if gems.empty?\n\n      version.to_a.each do |v|\n        raise InvalidOption, \"Invalid gem requirement pattern '#{v}'\" unless Gem::Requirement::PATTERN.match?(v.to_s)\n      end\n    end\n  end\nend\n","sourceCodeStart":40,"sourceCodeEnd":63,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/add.rb#L40-L63","documentation":"Error \"Invalid gem requirement pattern '#{v}'\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/cli/add.rb:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}