ruby/rubygems · error · Bundler::InvalidOption
15
15
Error message
The `bundle update --bundler` target version (#{target}) does not exist What it means
Error "The `bundle update --bundler` target version (#{target}) does not exist" thrown in ruby/rubygems.
Source
Thrown at lib/bundler/self_manager.rb:116
def needs_switching?(restart_version)
autoswitching_applies? &&
released?(restart_version) &&
!running?(restart_version)
end
def autoswitching_applies?
(ENV["BUNDLER_VERSION"].nil? || ENV["BUNDLER_VERSION"].empty?) &&
ruby_can_restart_with_same_arguments? &&
lockfile_version
end
def resolve_update_version_from(target)
requirement = Gem::Requirement.new(target)
update_candidate = find_latest_matching_spec(requirement)
if update_candidate.nil?
raise InvalidOption, "The `bundle update --bundler` target version (#{target}) does not exist"
end
resolved_version = update_candidate.version
needs_update = requirement.specific? ? !running?(resolved_version) : running_older_than?(resolved_version)
return unless needs_update
update_candidate
end
def local_specs
@local_specs ||= Bundler::Source::Rubygems.new("allow_local" => true).specs.select {|spec| spec.name == "bundler" }
end
def remote_specs
@remote_specs ||= begin
source = Bundler::Source::Rubygems.new("remotes" => "https://rubygems.org")
source.remote!View on GitHub (pinned to 86cbb817a3)
When it happens
Trigger: Thrown at lib/bundler/self_manager.rb:116 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/de4c437011f130fb.
Report an issue: GitHub.