Skip to content

Don't update bundler to a prerelease unless asked for one - #9869

Merged
hsbt merged 5 commits into
masterfrom
bundler-update-skips-prereleases
Sep 10, 2026
Merged

Don't update bundler to a prerelease unless asked for one#9869
hsbt merged 5 commits into
masterfrom
bundler-update-skips-prereleases

Conversation

@hsbt

@hsbt hsbt commented Sep 10, 2026

Copy link
Copy Markdown
Member

Since 4.1.0.beta1 was published, a bare bundle update --bundler or bundle lock --update --bundler moves the project onto the beta. The default requirement was > 0.a, and that .a is what tells the resolver and Bundler::SelfManager to consider prereleases.

The default is now >= <the running version>, the shape gem update --system uses, and prerelease candidates are skipped unless the requirement names one or --pre is given. A stable bundler therefore only moves to another stable release, while anyone already on a prerelease keeps it, since the floor is itself a prerelease requirement then. Naming a version, as in --bundler 4.0.20, is how someone whose lockfile is stuck on a beta gets back, and both man pages now say so.

Two smaller fixes fell out: find_latest_matching_spec compared a spec against nil when nothing on rubygems.org satisfied the floor, and --pre was silently ignored for --bundler.

Fixes #9867

Generated with Claude Code

hsbt and others added 5 commits September 10, 2026 11:28
`bundle update --bundler ">= <version>"` crashes with "comparison of
NilClass with Bundler::StubSpecification failed" when the requirement is
satisfied locally but by nothing on rubygems.org.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`bundle update --bundler` and `bundle lock --update --bundler` defaulted
to `> 0.a`, so publishing 4.1.0.beta1 moved every project onto the beta.
Default to `>= <running version>` and skip prerelease candidates unless
the requirement mentions one, the same way `gem update --system` does.
Anyone already running a prerelease keeps it, since the floor makes the
default requirement a prerelease requirement in that case.

#9867

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`bundle update --bundler --pre` did nothing: the self manager only looked
at whether the requirement named a prerelease, so it never considered one
and never restarted, leaving the flag silently ignored.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Auto switching restarts into whatever prerelease the lockfile names, so
the requirement derived from the running version is a prerelease one and
a bare `--bundler` keeps the prerelease. Naming the target explicitly is
the way out, and nothing pinned that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both man pages said a bare `--bundler` picks the latest version, which no
longer holds, and neither showed that a version or requirement can be
passed. That argument is now the way to reach a prerelease.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hsbt
hsbt merged commit 8c1f0fb into master Sep 10, 2026
109 checks passed
@hsbt
hsbt deleted the bundler-update-skips-prereleases branch September 10, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundler update --bundler installing beta bundler: 4.1.0.beta1

1 participant