ruby/rubygems · error · MalformattedPlugin

Source plugins need to override the install method.

Error message

Source plugins need to override the install method.

What it means

Error "Source plugins need to override the install method." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/plugin/api/source.rb:91

        def options_to_lock
          {}
        end

        # Download the gem specified by the spec at appropriate path.
        #
        # A source plugin can implement this method to split the download and the
        # installation of a gem.
        #
        # @return [Boolean] Whether the download of the gem succeeded.
        def download(spec, opts); end

        # Install the gem specified by the spec at appropriate path.
        # `install_path` provides a sufficient default, if the source can only
        # satisfy one gem,  but is not binding.
        #
        # @return [String] post installation message (if any)
        def install(spec, opts)
          raise MalformattedPlugin, "Source plugins need to override the install method."
        end

        # It builds extensions, generates bins and installs them for the spec
        # provided.
        #
        # It depends on `spec.loaded_from` to get full_gem_path. The source
        # plugins should set that.
        #
        # It should be called in `install` after the plugin is done placing the
        # gem at correct install location.
        #
        # It also runs Gem hooks `pre_install`, `post_build` and `post_install`
        #
        # Note: Do not override if you don't know what you are doing.
        def post_install(spec, disable_exts = false)
          opts = { env_shebang: false, disable_extensions: disable_exts }
          installer = Bundler::Source::Path::Installer.new(spec, opts)
          installer.post_install

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/plugin/api/source.rb:91 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/1901212d2b078c92. Report an issue: GitHub.