ruby/rubygems · error · MalformattedPlugin

#{PLUGIN_FILE_NAME} was not found in the plugin.

Error message

#{PLUGIN_FILE_NAME} was not found in the plugin.

What it means

Error "#{PLUGIN_FILE_NAME} was not found in the plugin." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/plugin.rb:307

    #
    # @param [Hash] specs of plugins mapped to installation path (currently they
    #               contain all the installed specs, including plugins)
    # @param [Array<String>] names of inferred source plugins that can be ignored
    def save_plugins(specs, optional_plugins = [])
      specs.each do |name, spec|
        save_plugin(name, spec, optional_plugins.include?(name))
      end
    end

    # Checks if the gem is good to be a plugin
    #
    # At present it only checks whether it contains plugins.rb file
    #
    # @param [Pathname] plugin_path the path plugin is installed at
    # @raise [MalformattedPlugin] if plugins.rb file is not found
    def validate_plugin!(plugin_path)
      plugin_file = plugin_path.join(PLUGIN_FILE_NAME)
      raise MalformattedPlugin, "#{PLUGIN_FILE_NAME} was not found in the plugin." unless plugin_file.file?
    end

    # Validates and registers a plugin.
    #
    # @param [String] name the name of the plugin
    # @param [Specification] spec of installed plugin
    # @param [Boolean] optional_plugin, removed if there is conflict with any
    #                     other plugin (used for default source plugins)
    #
    # @raise [PluginInstallError] if validation or registration raises any error
    def save_plugin(name, spec, optional_plugin = false)
      return if index.up_to_date?(spec)

      validate_plugin! Pathname.new(spec.full_gem_path)
      installed = register_plugin(name, spec, optional_plugin)
      Bundler.ui.info "Installed plugin #{name}" if installed
    rescue PluginError => e
      raise PluginInstallError, "Failed to install plugin `#{spec.name}`, due to #{e.class} (#{e.message})"

View on GitHub (pinned to 86cbb817a3)

When it happens

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