{"record":{"id":"bee65e191a2ed701","repo":"standardrb/standard","slug":"failed-while-configuring-plugin-plugin-name","errorCode":null,"errorMessage":"Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found","messagePattern":"Failed while configuring plugin `#(.+?)': no constant with name `#(.+?)' was found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/standard/plugin/determines_class_constant.rb","lineNumber":11,"sourceCode":"module Standard\n  module Plugin\n    class DeterminesClassConstant\n      def call(plugin_name, user_config)\n        require_plugin(user_config[\"require_path\"])\n\n        if (constant_name = user_config[\"plugin_class_name\"])\n          begin\n            Kernel.const_get(constant_name)\n          rescue\n            raise \"Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found\"\n          end\n        else\n          begin\n            Kernel.const_get(Gem.loaded_specs[plugin_name].metadata[\"default_lint_roller_plugin\"])\n          rescue LoadError, StandardError\n            raise <<~MSG\n              Failed loading plugin `#{plugin_name}' because we couldn't determine\n              the corresponding plugin class to instantiate.\n\n              Standard plugin class names must either be:\n\n                - If the plugin is a gem, defined in the gemspec as `default_lint_roller_plugin'\n\n                  spec.metadata[\"default_lint_roller_plugin\"] = \"MyModule::Plugin\"\n\n                - Set in YAML as `plugin_class_name'; example:\n\n                  plugins:","sourceCodeStart":1,"sourceCodeEnd":29,"githubUrl":"https://github.com/standardrb/standard/blob/c93189e2b31bb84cf5b365ccc244196f487f226f/lib/standard/plugin/determines_class_constant.rb#L1-L29","documentation":"Error \"Failed while configuring plugin `#{plugin_name}': no constant with name `#{constant_name}' was found\" thrown in standardrb/standard.","triggerScenarios":"Thrown at lib/standard/plugin/determines_class_constant.rb:11 when the library encounters an invalid state.","commonSituations":"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).","solutions":["Correct the plugin_class_name value in .standard.yml so it matches a constant actually defined by the plugin (e.g. MyModule::Plugin).","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.","Check the constant name for typos and correct namespace nesting; consult the plugin's documentation or source for the correct LintRoller plugin class."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c93189e2b31bb84cf5b365ccc244196f487f226f","analyzedAt":"2026-08-23T15:18:21.970Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}