{"record":{"id":"a189ccf83d7a524c","repo":"ruby/rubygems","slug":"only-one-of-source-git-or-path-may-be-spec","errorCode":null,"errorMessage":"Only one of --source, --git, or --path may be specified","messagePattern":"Only one of --source, --git, or --path may be specified","errorType":"exception","errorClass":"Bundler::InvalidOption","httpStatus":null,"severity":"error","filePath":"lib/bundler/plugin/installer.rb","lineNumber":53,"sourceCode":"      def install_definition(definition, latest = false)\n        def definition.lock(*); end\n\n        if latest || definition.missing_specs?\n          definition.remotely!\n        else\n          definition.with_cache!\n        end\n\n        specs = definition.specs\n\n        install_from_specs(specs)\n      end\n\n      private\n\n      def check_sources_consistency!(options)\n        if (options.keys & [:source, :git, :path]).length > 1\n          raise InvalidOption, \"Only one of --source, --git, or --path may be specified\"\n        end\n\n        if (options.key?(:branch) || options.key?(:ref)) && !options.key?(:git)\n          raise InvalidOption, \"--#{options.key?(:branch) ? \"branch\" : \"ref\"} can only be used with git sources\"\n        end\n\n        if options.key?(:branch) && options.key?(:ref)\n          raise InvalidOption, \"--branch and --ref can't be both specified\"\n        end\n      end\n\n      def install_git(names, version, options)\n        source_list = SourceList.new\n        source = source_list.add_git_source({ \"uri\" => options[:git],\n                                              \"branch\" => options[:branch],\n                                              \"ref\" => options[:ref] })\n\n        install_all_sources(names, version, source_list, source)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/plugin/installer.rb#L35-L71","documentation":"Error \"Only one of --source, --git, or --path may be specified\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/plugin/installer.rb:53 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"}