{"record":{"id":"d7a99a3350f02938","repo":"ruby/rubygems","slug":"failed-to-install-plugin-spec-name-due-to","errorCode":null,"errorMessage":"Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})","messagePattern":"Failed to install plugin `#(.+?)`, due to #(.+?) \\(#(.+?)\\)","errorType":"exception","errorClass":"PluginInstallError","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin.rb","lineNumber":325,"sourceCode":"      raise MalformattedPlugin, \"#{PLUGIN_FILE_NAME} was not found in the plugin.\" unless plugin_file.file?\n    end\n\n    # Validates and registers a plugin.\n    #\n    # @param [String] name the name of the plugin\n    # @param [Specification] spec of installed plugin\n    # @param [Boolean] optional_plugin, removed if there is conflict with any\n    #                     other plugin (used for default source plugins)\n    #\n    # @raise [PluginInstallError] if validation or registration raises any error\n    def save_plugin(name, spec, optional_plugin = false)\n      return if index.up_to_date?(spec)\n\n      validate_plugin! Pathname.new(spec.full_gem_path)\n      installed = register_plugin(name, spec, optional_plugin)\n      Bundler.ui.info \"Installed plugin #{name}\" if installed\n    rescue PluginError => e\n      raise PluginInstallError, \"Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})\"\n    end\n\n    # Runs the plugins.rb file in an isolated namespace, records the plugin\n    # actions it registers for and then passes the data to index to be stored.\n    #\n    # @param [String] name the name of the plugin\n    # @param [Specification] spec of installed plugin\n    # @param [Boolean] optional_plugin, removed if there is conflict with any\n    #                     other plugin (used for default source plugins)\n    #\n    # @raise [MalformattedPlugin] if plugins.rb raises any error\n    def register_plugin(name, spec, optional_plugin = false)\n      commands = @commands\n      sources = @sources\n      hooks = @hooks_by_event\n\n      @commands = {}\n      @sources = {}","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin.rb#L307-L343","documentation":"Error \"Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin.rb:325 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"}