ruby/rubygems · error · InvalidOption

15

15

Error message

The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). Did you mean `http` or `https`?

What it means

Error "The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). Did you mean `http` or `https`?" thrown in ruby/rubygems.

Source

Thrown at lib/bundler/fetcher/downloader.rb:125

        Bundler.ui.trace e

        raise HTTPError, "Network error while fetching #{filtered_uri}" \
            " (#{e})"
      end

      private

      def network_down_error(uri, filtered_uri)
        host = uri.host
        host_port = "#{host}:#{uri.port}"
        host = host_port if filtered_uri.to_s.include?(host_port)
        NetworkDownError.new("Could not reach host #{host}. Check your network " \
          "connection and try again.")
      end

      def validate_uri_scheme!(uri)
        return if /\Ahttps?\z/.match?(uri.scheme)
        raise InvalidOption,
          "The request uri `#{uri}` has an invalid scheme (`#{uri.scheme}`). " \
          "Did you mean `http` or `https`?"
      end
    end
  end
end

View on GitHub (pinned to 86cbb817a3)

When it happens

Trigger: Thrown at lib/bundler/fetcher/downloader.rb:125 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/9bf4055ed127ee2a. Report an issue: GitHub.