ruby/rubygems · error · ArgumentError

Event '#{event}' not defined in Bundler::Plugin::Events

Error message

Event '#{event}' not defined in Bundler::Plugin::Events

What it means

Error "Event '#{event}' not defined in Bundler::Plugin::Events" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/plugin.rb:249

    def from_lock(locked_opts)
      opts = locked_opts.merge("uri" => locked_opts["remote"])
      # when reading the lockfile while doing the plugin-install-from-gemfile phase,
      # we need to ignore any plugin sources
      return UnloadedSource.new(opts) if @gemfile_parse
      # use an inert placeholder when the plugin handling this source is not
      # installed, so that the lockfile can still be parsed
      return UnloadedSource.new(opts) unless source?(locked_opts["type"])

      src = source(locked_opts["type"])

      src.new(opts)
    end

    # To be called via the API to register a hooks and corresponding block that
    # will be called to handle the hook
    def add_hook(event, &block)
      unless Events.defined_event?(event)
        raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
      end
      @hooks_by_event[event.to_s] << block
    end

    # Runs all the hooks that are registered for the passed event
    #
    # It passes the passed arguments and block to the block registered with
    # the api.
    #
    # @param [String] event
    def hook(event, *args, &arg_blk)
      return unless Bundler.settings[:plugins]
      unless Events.defined_event?(event)
        raise ArgumentError, "Event '#{event}' not defined in Bundler::Plugin::Events"
      end

      plugins = index.hook_plugins(event)
      return unless plugins.any?

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/plugin.rb:249 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/cd5c7ab149b582f8. Report an issue: GitHub.