ruby/rubygems · error · ArgumentError
Gem sources must be absolute. You provided '%s'.
Error message
Gem sources must be absolute. You provided '%s'.
What it means
Error "Gem sources must be absolute. You provided '%s'." thrown in ruby/rubygems.
Source
Thrown at lib/bundler/settings.rb:547
key.upcase!
key.gsub(/\A([ #]*)/, '\1BUNDLE_')
end
# TODO: duplicates Rubygems#normalize_uri
# TODO: is this the correct place to validate mirror URIs?
def self.normalize_uri(uri)
uri = uri.to_s
if uri =~ NORMALIZE_URI_OPTIONS_PATTERN
prefix = $1
uri = $2
suffix = $3
end
uri = URINormalizer.normalize_suffix(uri)
require_relative "vendored_uri"
uri = Gem::URI(uri)
unless uri.absolute?
raise ArgumentError, format("Gem sources must be absolute. You provided '%s'.", uri)
end
"#{prefix}#{uri}#{suffix}"
end
# This is a hot method, so avoid respond_to? checks on every invocation
if :read.respond_to?(:name)
def self.key_to_s(key)
case key
when String
key
when Symbol
key.name
when Gem::URI::HTTP
key.to_s
else
raise ArgumentError, "Invalid key: #{key.inspect}"
end
endView on GitHub (pinned to 86cbb817a3)
When it happens
Trigger: Thrown at lib/bundler/settings.rb:547 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/dc06c58681a21aa2.
Report an issue: GitHub.