{"record":{"id":"e39f64a6c7dd14e5","repo":"ruby/rubygems","slug":"can-t-find-gem-dep-with-executable-exec-name","errorCode":null,"errorMessage":"can't find gem #{dep} with executable #{exec_name}","messagePattern":"can't find gem #(.+?) with executable #(.+?)","errorType":"exception","errorClass":"Gem::GemNotFoundException","httpStatus":null,"severity":"error","filePath":"lib/rubygems.rb","lineNumber":266,"sourceCode":"\n  def self.find_spec_for_exe(name, exec_name, requirements)\n    raise ArgumentError, \"you must supply exec_name\" unless exec_name\n\n    dep = Gem::Dependency.new name, requirements\n\n    loaded = Gem.loaded_specs[name]\n\n    return loaded if loaded && dep.matches_spec?(loaded)\n\n    specs = dep.matching_specs(true)\n\n    specs = specs.find_all do |spec|\n      spec.executables.include? exec_name\n    end if exec_name\n\n    unless spec = specs.first\n      msg = \"can't find gem #{dep} with executable #{exec_name}\"\n      raise Gem::GemNotFoundException, msg\n    end\n\n    spec\n  end\n  private_class_method :find_spec_for_exe\n\n  ##\n  # Find and load the full path to the executable for gem +name+.  If the\n  # +exec_name+ is not given, an exception will be raised, otherwise the\n  # specified executable's path is returned.  +requirements+ allows\n  # you to specify specific gem versions.\n  #\n  # A side effect of this method is that it will activate the gem that\n  # contains the executable.\n  #\n  # This method should *only* be used in bin stub files.\n\n  def self.activate_and_load_bin_path(name, exec_name = nil, *requirements)","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems.rb#L248-L284","documentation":"Error \"can't find gem #{dep} with executable #{exec_name}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems.rb:266 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"}