Skip to content

Commit 5cb0563

Browse files
committed
Merge pull request #9305 from ruby/add-doc-for-local-config
Clarify local gem override docs to require git-sourced gems (cherry picked from commit d0f6a30)
1 parent d8d10c2 commit 5cb0563

32 files changed

Lines changed: 63 additions & 33 deletions

bundler/lib/bundler/man/bundle-add.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-ADD" "1" "September 2025" ""
3+
.TH "BUNDLE\-ADD" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-add\fR \- Add gem to the Gemfile and run bundle install
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-binstubs.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-BINSTUBS" "1" "September 2025" ""
3+
.TH "BUNDLE\-BINSTUBS" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-binstubs\fR \- Install the binstubs of the listed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-cache.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CACHE" "1" "September 2025" ""
3+
.TH "BUNDLE\-CACHE" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-cache\fR \- Package your needed \fB\.gem\fR files into your application
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-check.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CHECK" "1" "September 2025" ""
3+
.TH "BUNDLE\-CHECK" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-check\fR \- Verifies if dependencies are satisfied by installed gems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-clean.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CLEAN" "1" "September 2025" ""
3+
.TH "BUNDLE\-CLEAN" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-clean\fR \- Cleans up unused gems in your bundler directory
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-config.1

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONFIG" "1" "September 2025" ""
3+
.TH "BUNDLE\-CONFIG" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-config\fR \- Set bundler configuration options
66
.SH "SYNOPSIS"
@@ -248,7 +248,16 @@ bundle config set \-\-local local\.GEM_NAME /path/to/local/git/repository
248248
.fi
249249
.IP "" 0
250250
.P
251-
For example, in order to use a local Rack repository, a developer could call:
251+
Important: This feature only works for gems that are specified with a git source in your Gemfile\. It does not work for gems installed from RubyGems or other sources\. The gem must be defined with \fBgit:\fR option pointing to a remote repository\.
252+
.P
253+
For example, if your Gemfile contains:
254+
.IP "" 4
255+
.nf
256+
gem "rack", git: "https://github\.com/rack/rack\.git", branch: "main"
257+
.fi
258+
.IP "" 0
259+
.P
260+
Then you can use a local Rack repository by running:
252261
.IP "" 4
253262
.nf
254263
bundle config set \-\-local local\.rack ~/Work/git/rack
@@ -260,6 +269,13 @@ Now instead of checking out the remote git repository, the local override will b
260269
Bundler does many checks to ensure a developer won't work with invalid references\. Particularly, we force a developer to specify a branch in the \fBGemfile\fR in order to use this feature\. If the branch specified in the \fBGemfile\fR and the current branch in the local git repository do not match, Bundler will abort\. This ensures that a developer is always working against the correct branches, and prevents accidental locking to a different branch\.
261270
.P
262271
Finally, Bundler also ensures that the current revision in the \fBGemfile\.lock\fR exists in the local git repository\. By doing this, Bundler forces you to fetch the latest changes in the remotes\.
272+
.P
273+
If you need to temporarily use a local version of a gem that is normally installed from RubyGems (not from git), use a path source instead:
274+
.IP "" 4
275+
.nf
276+
gem "rack", path: "~/Work/git/rack"
277+
.fi
278+
.IP "" 0
263279
.SH "MIRRORS OF GEM SOURCES"
264280
Bundler supports overriding gem sources with mirrors\. This allows you to configure rubygems\.org as the gem source in your Gemfile while still using your mirror to fetch gems\.
265281
.IP "" 4

bundler/lib/bundler/man/bundle-config.1.ronn

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,16 @@ up a local override:
295295

296296
bundle config set --local local.GEM_NAME /path/to/local/git/repository
297297

298-
For example, in order to use a local Rack repository, a developer could call:
298+
Important: This feature only works for gems that are specified with a git
299+
source in your Gemfile. It does not work for gems installed from RubyGems
300+
or other sources. The gem must be defined with `git:` option pointing to a
301+
remote repository.
302+
303+
For example, if your Gemfile contains:
304+
305+
gem "rack", git: "https://github.com/rack/rack.git", branch: "main"
306+
307+
Then you can use a local Rack repository by running:
299308

300309
bundle config set --local local.rack ~/Work/git/rack
301310

@@ -321,6 +330,11 @@ Finally, Bundler also ensures that the current revision in the
321330
`Gemfile.lock` exists in the local git repository. By doing this, Bundler
322331
forces you to fetch the latest changes in the remotes.
323332

333+
If you need to temporarily use a local version of a gem that is normally
334+
installed from RubyGems (not from git), use a path source instead:
335+
336+
gem "rack", path: "~/Work/git/rack"
337+
324338
## MIRRORS OF GEM SOURCES
325339

326340
Bundler supports overriding gem sources with mirrors. This allows you to

bundler/lib/bundler/man/bundle-console.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-CONSOLE" "1" "September 2025" ""
3+
.TH "BUNDLE\-CONSOLE" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-console\fR \- Open an IRB session with the bundle pre\-loaded
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-doctor.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-DOCTOR" "1" "September 2025" ""
3+
.TH "BUNDLE\-DOCTOR" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-doctor\fR \- Checks the bundle for common problems
66
.SH "SYNOPSIS"

bundler/lib/bundler/man/bundle-env.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" generated with Ronn-NG/v0.10.1
22
.\" http://github.com/apjanke/ronn-ng/tree/0.10.1
3-
.TH "BUNDLE\-ENV" "1" "September 2025" ""
3+
.TH "BUNDLE\-ENV" "1" "February 2026" ""
44
.SH "NAME"
55
\fBbundle\-env\fR \- Print information about the environment Bundler is running under
66
.SH "SYNOPSIS"

0 commit comments

Comments
 (0)