ruby/rubygems · error · Bundler::Source::Git::GitNotInstalledError

11

11

Error message

You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git

What it means

Error "You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/source/git/git_proxy.rb:66

          msg = "Specification of branch or ref with tag is ambiguous. You specified #{options.inspect}"
          super msg
        end
      end

      # The GitProxy is responsible to interact with git repositories.
      # All actions required by the Git source is encapsulated in this
      # object.
      class GitProxy
        attr_accessor :path, :uri, :branch, :tag, :ref, :explicit_ref
        attr_writer :revision

        def self.version
          @version ||= full_version[/((\.?\d+)+).*/, 1]
        end

        def self.full_version
          @full_version ||= begin
            raise GitNotInstalledError.new unless Bundler.git_present?

            require "open3"
            out, err, status = Open3.capture3("git", "--version")

            raise GitCommandError.new("--version", SharedHelpers.pwd, err) unless status.success?
            Bundler.ui.warn err unless err.empty?

            out.sub(/git version\s*/, "").strip
          end
        end

        def self.reset
          @version = nil
          @full_version = nil
        end

        def initialize(path, uri, options = {}, revision = nil, git = nil)
          @path     = path

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/source/git/git_proxy.rb:66 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23). Data as JSON: /api/errors/cbcc1151bd534ec4. Report an issue: GitHub.