{"record":{"id":"2c376d737a9f252f","repo":"ruby/rubygems","slug":"source-s-sources-join-declared-by","errorCode":null,"errorMessage":"Source(s) `#{sources.join(\"`, `\")}` declared by #{plugin} are already registered.","messagePattern":"Source\\(s\\) `#(.+?)` declared by #(.+?) are already registered\\.","errorType":"exception","errorClass":"SourceConflict","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin/index.rb","lineNumber":62,"sourceCode":"\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\n\n      def unregister_plugin(name)\n        @commands.delete_if {|_, v| v == name }\n        @sources.delete_if {|_, v| v == name }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin/index.rb#L44-L80","documentation":"Error \"Source(s) `#{sources.join(\"`, `\")}` declared by #{plugin} are already registered.\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin/index.rb:62 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"}