{"record":{"id":"b7907eff39af1eac","repo":"ruby/rubygems","slug":"please-specify-a-gem-name-or-a-gem-file-on-the-co","errorCode":null,"errorMessage":"Please specify a gem name or a .gem file on the command line","messagePattern":"Please specify a gem name or a \\.gem file on the command line","errorType":"exception","errorClass":"Gem::CommandLineError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/commands/specification_command.rb","lineNumber":79,"sourceCode":"Specific fields in the specification can be extracted in YAML format:\n\n  $ gem spec rake summary\n  --- Ruby based make-like utility.\n  ...\n\n    EOF\n  end\n\n  def usage # :nodoc:\n    \"#{program_name} [GEM_OR_FILE] [FIELD]\"\n  end\n\n  def execute\n    specs = []\n    gem = options[:args].shift\n\n    unless gem\n      raise Gem::CommandLineError,\n            \"Please specify a gem name or a .gem file on the command line\"\n    end\n\n    case v = options[:version]\n    when String\n      req = Gem::Requirement.create v\n    when Gem::Requirement\n      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]","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/commands/specification_command.rb#L61-L97","documentation":"Error \"Please specify a gem name or a .gem file on the command line\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/commands/specification_command.rb:79 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"}