{"record":{"id":"ae47fbfc7565bbbf","repo":"ruby/rubygems","slug":"command-s-commands-join-declared-by","errorCode":null,"errorMessage":"Command(s) `#{commands.join(\"`, `\")}` declared by #{plugin} are already registered.","messagePattern":"Command\\(s\\) `#(.+?)` declared by #(.+?) are already registered\\.","errorType":"exception","errorClass":"CommandConflict","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin/index.rb","lineNumber":58,"sourceCode":"          nil\n        end\n        load_index(local_index_file) if SharedHelpers.in_bundle?\n      end\n\n      # This function is to be called when a new plugin is installed. This\n      # function shall add the functions of the plugin to existing maps and also\n      # the name to source location.\n      #\n      # @param [String] name of the plugin to be registered\n      # @param [String] path where the plugin is installed\n      # @param [Array<String>] load_paths for the plugin\n      # @param [Array<String>] commands that are handled by the plugin\n      # @param [Array<String>] sources that are handled by the plugin\n      def register_plugin(name, path, load_paths, commands, sources, hooks)\n        old_commands = @commands.dup\n\n        common = commands & @commands.keys\n        raise CommandConflict.new(name, common) unless common.empty?\n        commands.each {|c| @commands[c] = name }\n\n        common = sources & @sources.keys\n        raise SourceConflict.new(name, common) unless common.empty?\n        sources.each {|k| @sources[k] = name }\n\n        hooks.each do |event|\n          event_hooks = (@hooks[event] ||= []) << name\n          event_hooks.uniq!\n        end\n\n        @plugin_paths[name] = path\n        @load_paths[name] = load_paths\n        save_index\n      rescue StandardError\n        @commands = old_commands\n        raise\n      end","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin/index.rb#L40-L76","documentation":"Error \"Command(s) `#{commands.join(\"`, `\")}` declared by #{plugin} are already registered.\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin/index.rb:58 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"}