ruby/rubygems · error · Bundler::PathError

13

13

Error message

Your bundle path contains text matching #{path_separator.inspect}, which is the path separator for your system. Bundler cannot function correctly when the Bundle path contains the system's PATH separator. Please change your bundle path to not match #{path_separator.inspect}.
Your current bundle path is '#{Bundler.bundle_path}'.

What it means

Error "Your bundle path contains text matching #{path_separator.inspect}, which is the path separator for your system. Bundler cannot function correctly when the Bundle path contains the system's PATH separator. Please change your bundle path to not match #{path_separator.inspect}. Your current bundle path is '#{Bundler.bundle_path}'." thrown in ruby/rubygems.

Source

Thrown at lib/bundler/shared_helpers.rb:246

    def relative_path_to(destination, from: pwd)
      Pathname.new(destination).relative_path_from(from).to_s
    rescue ArgumentError
      # on Windows, if source and destination are on different drivers, there's no relative path from one to the other
      destination
    end

    private

    def validate_bundle_path
      path_separator = Bundler.rubygems.path_separator
      return unless Bundler.bundle_path.to_s.split(path_separator).size > 1
      message = "Your bundle path contains text matching #{path_separator.inspect}, " \
                "which is the path separator for your system. Bundler cannot " \
                "function correctly when the Bundle path contains the " \
                "system's PATH separator. Please change your " \
                "bundle path to not match #{path_separator.inspect}." \
                "\nYour current bundle path is '#{Bundler.bundle_path}'."
      raise Bundler::PathError, message
    end

    def find_gemfile
      given = ENV["BUNDLE_GEMFILE"]
      return given if given && !given.empty?
      find_file(*gemfile_names)
    end

    def gemfile_names
      ["gems.rb", "Gemfile"]
    end

    def find_file(*names)
      search_up(*names) do |filename|
        return filename if File.file?(filename)
      end
    end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/shared_helpers.rb:246 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/0c2c31798ef81495. Report an issue: GitHub.