{"record":{"id":"74d39991146810bd","repo":"ruby/rubygems","slug":"the-name-only-and-paths-options-cannot-be","errorCode":null,"errorMessage":"The `--name-only` and `--paths` options cannot be used together","messagePattern":"The `--name-only` and `--paths` options cannot be used together","errorType":"exception","errorClass":"Bundler::InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/list.rb","lineNumber":17,"sourceCode":"# frozen_string_literal: true\n\nrequire \"json\"\n\nmodule Bundler\n  class CLI::List\n    def initialize(options)\n      @options = options\n      @without_group = options[\"without-group\"].map(&:to_sym)\n      @only_group = options[\"only-group\"].map(&:to_sym)\n      @format = options[\"format\"]\n    end\n\n    def run\n      raise InvalidOption, \"The `--only-group` and `--without-group` options cannot be used together\" if @only_group.any? && @without_group.any?\n\n      raise InvalidOption, \"The `--name-only` and `--paths` options cannot be used together\" if @options[\"name-only\"] && @options[:paths]\n\n      specs = if @only_group.any? || @without_group.any?\n        filtered_specs_by_groups\n      else\n        begin\n          Bundler.load.specs\n        rescue GemNotFound => e\n          Bundler.ui.error e.message\n          Bundler.ui.warn \"Install missing gems with `bundle install`.\"\n          exit 1\n        end\n      end.reject {|s| s.name == \"bundler\" }.sort_by(&:name)\n\n      case @format\n      when \"json\"\n        print_json(specs: specs)\n      when nil\n        print_human(specs: specs)","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/list.rb#L1-L35","documentation":"Error \"The `--name-only` and `--paths` options cannot be used together\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/cli/list.rb:17 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"}