{"record":{"id":"cd5c7ab149b582f8","repo":"ruby/rubygems","slug":"event-event-not-defined-in-bundler-plugin-e","errorCode":null,"errorMessage":"Event '#{event}' not defined in Bundler::Plugin::Events","messagePattern":"Event '#(.+?)' not defined in Bundler::Plugin::Events","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin.rb","lineNumber":249,"sourceCode":"    def from_lock(locked_opts)\n      opts = locked_opts.merge(\"uri\" => locked_opts[\"remote\"])\n      # when reading the lockfile while doing the plugin-install-from-gemfile phase,\n      # we need to ignore any plugin sources\n      return UnloadedSource.new(opts) if @gemfile_parse\n      # use an inert placeholder when the plugin handling this source is not\n      # installed, so that the lockfile can still be parsed\n      return UnloadedSource.new(opts) unless source?(locked_opts[\"type\"])\n\n      src = source(locked_opts[\"type\"])\n\n      src.new(opts)\n    end\n\n    # To be called via the API to register a hooks and corresponding block that\n    # will be called to handle the hook\n    def add_hook(event, &block)\n      unless Events.defined_event?(event)\n        raise ArgumentError, \"Event '#{event}' not defined in Bundler::Plugin::Events\"\n      end\n      @hooks_by_event[event.to_s] << block\n    end\n\n    # Runs all the hooks that are registered for the passed event\n    #\n    # It passes the passed arguments and block to the block registered with\n    # the api.\n    #\n    # @param [String] event\n    def hook(event, *args, &arg_blk)\n      return unless Bundler.settings[:plugins]\n      unless Events.defined_event?(event)\n        raise ArgumentError, \"Event '#{event}' not defined in Bundler::Plugin::Events\"\n      end\n\n      plugins = index.hook_plugins(event)\n      return unless plugins.any?","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin.rb#L231-L267","documentation":"Error \"Event '#{event}' not defined in Bundler::Plugin::Events\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin.rb:249 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"}