{"record":{"id":"425b072cc7e54c8e","repo":"ruby/rubygems","slug":"cannot-specify-path-option-without-a-value","errorCode":null,"errorMessage":"Cannot specify `--path` option without a value","messagePattern":"Cannot specify `--path` option without a value","errorType":"exception","errorClass":"InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/cli/open.rb","lineNumber":13,"sourceCode":"# frozen_string_literal: true\n\nmodule Bundler\n  class CLI::Open\n    attr_reader :options, :name, :path\n    def initialize(options, name)\n      @options = options\n      @name = name\n      @path = options[:path] unless options[:path].nil?\n    end\n\n    def run\n      raise InvalidOption, \"Cannot specify `--path` option without a value\" if !@path.nil? && @path.empty?\n      editor = [ENV[\"BUNDLER_EDITOR\"], ENV[\"VISUAL\"], ENV[\"EDITOR\"]].find {|e| !e.nil? && !e.empty? }\n      return Bundler.ui.info(\"To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR\") unless editor\n      return unless spec = Bundler::CLI::Common.select_spec(name, :regex_match)\n      if spec.default_gem?\n        Bundler.ui.info \"Unable to open #{name} because it's a default gem, so the directory it would normally be installed to does not exist.\"\n      else\n        root_path = spec.full_gem_path\n        command = editor_command(editor) << File.join([root_path, path].compact)\n        Bundler.with_original_env do\n          system(*command, { chdir: root_path })\n        end || Bundler.ui.info(\"Could not run '#{command.join(\" \")}'\")\n      end\n    end\n\n    def editor_command(editor)\n      # On Windows an editor is often configured with a full path such as\n      # C:\\Program Files\\Microsoft VS Code\\Code.exe, which shell splitting\n      # would corrupt. Take a value that names an existing file as a","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/cli/open.rb#L1-L31","documentation":"Error \"Cannot specify `--path` option without a value\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/cli/open.rb:13 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"}