{"record":{"id":"b15c13d9bb62a954","repo":"ruby/rubygems","slug":"you-can-no-longer-specify-a-git-source-by-itself","errorCode":null,"errorMessage":"You can no longer specify a git source by itself. Instead, \neither use the :git option on a gem, or specify the gems that \nbundler should find in the git source by passing a block to \nthe git method, like: \n\n  git 'git://github.com/rails/rails.git' do\n    gem 'rails'\n  end","messagePattern":"You can no longer specify a git source by itself\\. Instead, \neither use the :git option on a gem, or specify the gems that \nbundler should find in the git source by passing a block to \nthe git method, like: \n\n  git 'git://github\\.com/rails/rails\\.git' do\n    gem 'rails'\n  end","errorType":"exception","errorClass":"DeprecatedError","httpStatus":null,"severity":"error","filePath":"lib/bundler/dsl.rb","lineNumber":184,"sourceCode":"        \"root_path\" => gemfile_root\n      )\n\n      source_options[\"global\"] = true unless block_given?\n\n      source = @sources.add_path_source(source_options)\n      with_source(source, &blk)\n    end\n\n    def git(uri, options = {}, &blk)\n      unless block_given?\n        msg = \"You can no longer specify a git source by itself. Instead, \\n\" \\\n              \"either use the :git option on a gem, or specify the gems that \\n\" \\\n              \"bundler should find in the git source by passing a block to \\n\" \\\n              \"the git method, like: \\n\\n\" \\\n              \"  git 'git://github.com/rails/rails.git' do\\n\" \\\n              \"    gem 'rails'\\n\" \\\n              \"  end\"\n        raise DeprecatedError, msg\n      end\n\n      with_source(@sources.add_git_source(normalize_hash(options).merge(\"uri\" => uri)), &blk)\n    end\n\n    def github(repo, options = {})\n      raise InvalidArgumentError, \"GitHub sources require a block\" unless block_given?\n      github_uri  = @git_sources[\"github\"].call(repo)\n      git_options = normalize_hash(options).merge(\"uri\" => github_uri)\n      git_source  = @sources.add_git_source(git_options)\n      with_source(git_source) { yield }\n    end\n\n    SUPPORTED_OVERRIDE_FIELDS = [:version, :required_ruby_version, :required_rubygems_version].freeze\n    SUPPORTED_OVERRIDE_SYMBOL_OPERATIONS = [:ignore_upper].freeze\n\n    def override(target, **operations)\n      validate_override_target!(target)","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/dsl.rb#L166-L202","documentation":"Error \"You can no longer specify a git source by itself. Instead, \neither use the :git option on a gem, or specify the gems that \nbundler should find in the git source by passing a block to \nthe git method, like: \n\n  git 'git://github.com/rails/rails.git' do\n    gem 'rails'\n  end\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/dsl.rb:184 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"}