ruby/rubygems · error · Bundler::InvalidOption

15

15

Error message

Using a custom path while using system gems is unsupported.
#{path.join("\n")}
#{system_path.join("\n")}
#{disable_shared_gems.join("\n")}

What it means

Error "Using a custom path while using system gems is unsupported. #{path.join("\n")} #{system_path.join("\n")} #{disable_shared_gems.join("\n")}" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/settings.rb:297

        if relative_path.to_s.start_with?("..")
          relative_path = base_path if base_path.absolute?
        else
          relative_path = Pathname.new(File.join(".", relative_path))
        end
        relative_path
      rescue ArgumentError
        expanded_base_path
      end

      def validate!
        return unless explicit_path && system_path
        path = Bundler.settings.pretty_values_for(:path)
        path.unshift(nil, "path:") unless path.empty?
        system_path = Bundler.settings.pretty_values_for("path.system")
        system_path.unshift(nil, "path.system:") unless system_path.empty?
        disable_shared_gems = Bundler.settings.pretty_values_for(:disable_shared_gems)
        disable_shared_gems.unshift(nil, "disable_shared_gems:") unless disable_shared_gems.empty?
        raise InvalidOption,
          "Using a custom path while using system gems is unsupported.\n#{path.join("\n")}\n#{system_path.join("\n")}\n#{disable_shared_gems.join("\n")}"
      end
    end

    def ignore_config?
      ENV["BUNDLE_IGNORE_CONFIG"]
    end

    def app_cache_path
      @app_cache_path ||= self[:cache_path] || "vendor/cache"
    end

    def installation_parallelization
      self[:jobs] || processor_count
    end

    def validate!
      all.each do |raw_key|

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/settings.rb:297 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/c4817de2d638865a. Report an issue: GitHub.