{"record":{"id":"5d61d690b245a317","repo":"ruby/rubygems","slug":"github-sources-require-a-block","errorCode":null,"errorMessage":"GitHub sources require a block","messagePattern":"GitHub sources require a block","errorType":"exception","errorClass":"InvalidArgumentError","httpStatus":null,"severity":"error","filePath":"lib/bundler/dsl.rb","lineNumber":191,"sourceCode":"    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)\n\n      if target == :all && operations.key?(:version)\n        raise ArgumentError, \"`override :all, version:` is not allowed; version requirements are per-gem\"\n      end\n\n      operations.each do |field, operation|\n        validate_override_field!(field)","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/bundler/dsl.rb#L173-L209","documentation":"Error \"GitHub sources require a block\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/bundler/dsl.rb:191 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"}