ruby/rubygems · error · Bundler::Plugin::UndefinedCommandError

29

29

Error message

Command `#{command}` not found

What it means

Error "Command `#{command}` not found" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/plugin.rb:197

    # The cache directory for plugin stuffs
    def cache
      @cache ||= root.join("cache")
    end

    # To be called via the API to register to handle a command
    def add_command(command, cls)
      @commands[command] = cls
    end

    # Checks if any plugin handles the command
    def command?(command)
      !index.command_plugin(command).nil?
    end

    # To be called from Cli class to pass the command and argument to
    # appropriate plugin class
    def exec_command(command, args)
      raise UndefinedCommandError, "Command `#{command}` not found" unless command? command

      load_plugin index.command_plugin(command) unless @commands.key? command

      @commands[command].new.exec(command, args)
    end

    # To be called via the API to register to handle a source plugin
    def add_source(source, cls)
      @sources[source] = cls
    end

    # Checks if any plugin declares the source
    def source?(name)
      !!source_plugin(name)
    end

    # Returns the plugin that handles the source +name+ if any
    def source_plugin(name)

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/plugin.rb:197 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/eaf2fadccd39d644. Report an issue: GitHub.