{"record":{"id":"983f50883dc07419","repo":"ruby/rubygems","slug":"ruby-and-field-are-mutually-exclusive","errorCode":null,"errorMessage":"--ruby and FIELD are mutually exclusive","messagePattern":"--ruby and FIELD are mutually exclusive","errorType":"exception","errorClass":"Gem::CommandLineError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/commands/specification_command.rb","lineNumber":105,"sourceCode":"      req = v\n    else\n      raise Gem::CommandLineError, \"Unsupported version type: '#{v}'\"\n    end\n\n    if !req.none? && options[:all]\n      alert_error \"Specify --all or -v, not both\"\n      terminate_interaction 1\n    end\n\n    if options[:all]\n      dep = Gem::Dependency.new gem\n    else\n      dep = Gem::Dependency.new gem, req\n    end\n\n    field = get_one_optional_argument\n\n    raise Gem::CommandLineError, \"--ruby and FIELD are mutually exclusive\" if\n      field && options[:format] == :ruby\n\n    if local?\n      if File.exist? gem\n        begin\n          specs << Gem::Package.new(gem).spec\n        rescue StandardError\n          nil\n        end\n      end\n\n      if specs.empty?\n        specs.push(*dep.matching_specs)\n      end\n    end\n\n    if remote?\n      dep.prerelease = options[:prerelease]","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/commands/specification_command.rb#L87-L123","documentation":"Error \"--ruby and FIELD are mutually exclusive\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/commands/specification_command.rb:105 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"}