standardrb/standard · error

Failed while configuring plugin `#{plugin_name}': no constan

Error message

Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found

What it means

Error "Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found" thrown in standardrb/standard.

Source

Thrown at lib/standard/plugin/determines_class_constant.rb:11

module Standard
  module Plugin
    class DeterminesClassConstant
      def call(plugin_name, user_config)
        require_plugin(user_config["require_path"])

        if (constant_name = user_config["plugin_class_name"])
          begin
            Kernel.const_get(constant_name)
          rescue
            raise "Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found"
          end
        else
          begin
            Kernel.const_get(Gem.loaded_specs[plugin_name].metadata["default_lint_roller_plugin"])
          rescue LoadError, StandardError
            raise <<~MSG
              Failed loading plugin `#{plugin_name}' because we couldn't determine
              the corresponding plugin class to instantiate.

              Standard plugin class names must either be:

                - If the plugin is a gem, defined in the gemspec as `default_lint_roller_plugin'

                  spec.metadata["default_lint_roller_plugin"] = "MyModule::Plugin"

                - Set in YAML as `plugin_class_name'; example:

                  plugins:

View on GitHub (pinned to c93189e2b3)

Solutions

  1. Correct the plugin_class_name value in .standard.yml so it matches a constant actually defined by the plugin (e.g. MyModule::Plugin).
  2. Make sure the plugin is loaded before the constant lookup by setting require_path in the plugin entry of .standard.yml to the file that defines the class.
  3. Check the constant name for typos and correct namespace nesting; consult the plugin's documentation or source for the correct LintRoller plugin class.

When it happens

Trigger: Thrown at lib/standard/plugin/determines_class_constant.rb:11 when the library encounters an invalid state.

Common situations: Defense: raised when a plugin entry in .standard.yml sets `plugin_class_name` but Kernel.const_get cannot find that constant after requiring require_path. Verify the constant name is spelled exactly (including module nesting, e.g. MyModule::Plugin), that require_path actually defines that constant (check the gem's lib file), and that the gem version you installed still ships the class (renamed namespaces after a plugin upgrade are a common cause).


AI-assisted analysis of standardrb/standard@c93189e2b3 (2026-08-23). Data as JSON: /api/errors/bee65e191a2ed701. Report an issue: GitHub.