This repository was archived by the owner on Jul 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbundle_config.html
524 lines (449 loc) · 19.7 KB
/
bundle_config.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<meta content='IE=edge' http-equiv='X-UA-Compatible'>
<meta content='en' http-equiv='Content-Language'>
<meta content='width=device-width, initial-scale=1' name='viewport'>
<meta content='276VSYOko8B8vIu1i8i5qbj7_ql5PXo0dU69XQy-SL' name='globalsign-domain-verification'>
<title>
Bundler: bundle config
</title>
<link href='/bundle_config.html' rel='canonical'>
<script src="/application.min.js"></script>
<link href="/application.css" rel="stylesheet" />
<link href='/images/apple-touch-icon.png' rel='apple-touch-icon' sizes='180x180'>
<link href='/images/favicon-32x32.png' rel='icon' sizes='32x32' type='image/png'>
<link href='/images/favicon-16x16.png' rel='icon' sizes='16x16' type='image/png'>
<link href='/manifest.json' rel='manifest'>
<link color='#50bced' href='/images/safari-pinned-tab.svg' rel='mask-icon'>
<meta content='bundler.io' name='apple-mobile-web-app-title'>
<meta content='bundler.io' name='application-name'>
<meta content='#ffffff' name='theme-color'>
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/blog/feed.xml" />
</head>
<body class=''>
<nav class='navbar navbar-expand-md navbar-light'>
<div class='container-md'>
<a href="/" class="navbar-brand me-auto fw-bold">Bundler</a>
<button aria-controls='bs-navbar-collapse' aria-expanded='false' aria-label='Toggle navigation' class='navbar-toggler' data-bs-target='#bs-navbar-collapse' data-bs-toggle='collapse' type='button'>
<span class='navbar-toggler-icon'></span>
</button>
<div class='collapse navbar-collapse flex-grow-0' id='bs-navbar-collapse'>
<ul class='navbar-nav'>
<li class='nav-item'>
<input class='input-search my-1 ps-1 pt-1' id='input-search' placeholder='Type to search...' type='text'>
<svg class='text-opacity-40 m-1 mb-2' style='width: 1rem; height: 1rem; fill: currentcolor;' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'>
<!-- Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. -->
<path d='M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z'></path>
</svg>
</li>
<li class='nav-item'><a href="/docs.html" class="nav-link">Docs</a></li>
<li class='nav-item'><a href="/contributors.html" class="nav-link">Team</a></li>
<li class='nav-item'><a href="/blog" class="nav-link">Blog</a></li>
<li class='nav-item'><a href="https://github.com/rubygems/rubygems/tree/master/bundler" target="_blank" rel="noopener noreferrer" class="nav-link">Repository</a></li>
</ul>
</div>
</div>
</nav>
<div class='bg-light-blue header'>
<img src="/images/docs_header_transparent_bg.png" srcset="/images/docs_header_transparent_bg.png 1x, /images/[email protected] 2x, /images/[email protected] 3x" class="img-fluid header-padding" style="max-width: 400px;" alt="" />
</div>
<div class='container'>
<div class='row flex-column flex-md-row-reverse'>
<div class='col-12 col-md-9 contents commands' id='page-content-wrapper'>
<div class="mp" id="man">
<h2 id="NAME">bundle config</h2>
<p class="man-name">
<code>bundle-config</code> - <span class="man-whatis">Set bundler configuration options</span>
</p>
<pre><code>bundle config</code> [<var>name</var> [<var>value</var>]]</pre>
<h2 id="DESCRIPTION">Description</h2>
<p>This command allows you to interact with bundler's configuration system.
Bundler retrieves its configuration from the local application (<code>app/.bundle/config</code>),
environment variables, and the user's home directory (<code>~/.bundle/config</code>),
in that order of priority.</p>
<p>Executing <code>bundle config</code> with no parameters will print a list of all
bundler configuration for the current bundle, and where that configuration
was set.</p>
<p>Executing <code>bundle config <name></code> will print the value of that configuration
setting, and where it was set.</p>
<p>Executing <code>bundle config <name> <value></code> will set that configuration to the
value specified for all bundles executed as the current user. The configuration
will be stored in <code>~/.bundle/config</code>. If <var>name</var> already is set, <var>name</var> will be
overridden and user will be warned.</p>
<p>Executing <code>bundle config --global <name> <value></code> works the same as above.</p>
<p>Executing <code>bundle config --local <name> <value></code> will set that configuration to
the local application. The configuration will be stored in <code>app/.bundle/config</code>.</p>
<p>Executing <code>bundle config --delete <name></code> will delete the configuration in both
local and global sources. Not compatible with --global or --local flag.</p>
<p>Executing bundle with the <code>BUNDLE_IGNORE_CONFIG</code> environment variable set will
cause it to ignore all configuration.</p>
<p>Executing <code>bundle config disable_multisource true</code> upgrades the warning about
the Gemfile containing multiple primary sources to an error. Executing <code>bundle
config --delete disable_multisource</code> downgrades this error to a warning.</p>
<h2 id="REMEMBERING-OPTIONS">Remembering Options</h2>
<p>Flags passed to <code>bundle install</code> or the Bundler runtime,
such as <code>--path foo</code> or <code>--without production</code>, are not remembered between commands.
If these options must be remembered,they must be set using <code>bundle config</code>
(e.g., <code>bundle config path foo</code>).</p>
<p>The options that can be configured are:</p>
<dl>
<dt><code>binstubs</code></dt>
<dd><p>Creates a directory (defaults to <code>~/bin</code>) and place any executables from the
gem there. These executables run in Bundler's context. If used, you might add
this directory to your environment's <code>PATH</code> variable. For instance, if the
<code>rails</code> gem comes with a <code>rails</code> executable, this flag will create a
<code>bin/rails</code> executable that ensures that all referred dependencies will be
resolved using the bundled gems.</p></dd>
<dt><code>deployment</code></dt>
<dd><p>In deployment mode, Bundler will 'roll-out' the bundle for
<code>production</code> use. Please check carefully if you want to have this option
enabled in <code>development</code> or <code>test</code> environments.</p></dd>
<dt class="flush"><code>path</code></dt>
<dd><p>The location to install the specified gems to. This defaults to Rubygems'
setting. Bundler shares this location with Rubygems, <code>gem install ...</code> will
have gem installed there, too. Therefore, gems installed without a
<code>--path ...</code> setting will show up by calling <code>gem list</code>. Accodingly, gems
installed to other locations will not get listed.</p></dd>
<dt class="flush"><code>without</code></dt>
<dd><p>A space-separated list of groups referencing gems to skip during installation.</p></dd>
</dl>
<h2 id="BUILD-OPTIONS">Build Options</h2>
<p>You can use <code>bundle config</code> to give bundler the flags to pass to the gem
installer every time bundler tries to install a particular gem.</p>
<p>A very common example, the <code>mysql</code> gem, requires Snow Leopard users to
pass configuration flags to <code>gem install</code> to specify where to find the
<code>mysql_config</code> executable.</p>
<pre><code>gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
</code></pre>
<p>Since the specific location of that executable can change from machine
to machine, you can specify these flags on a per-machine basis.</p>
<pre><code>bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
</code></pre>
<p>After running this command, every time bundler needs to install the
<code>mysql</code> gem, it will pass along the flags you specified.</p>
<h2 id="CONFIGURATION-KEYS">Configuration Keys</h2>
<p>Configuration keys in bundler have two forms: the canonical form and the
environment variable form.</p>
<p>For instance, passing the <code>--without</code> flag to <a href="bundle-install.1.html">bundle install(1)</a>
prevents Bundler from installing certain groups specified in the <a class="man-ref" href="gemfile.5.html">Gemfile<span class="s">(5)</span></a>. Bundler
persists this value in <code>app/.bundle/config</code> so that calls to <code>Bundler.setup</code>
do not try to find gems from the <code>Gemfile</code> that you didn't install. Additionally,
subsequent calls to <a href="bundle-install.1.html">bundle install(1)</a> remember this setting and skip those
groups.</p>
<p>The canonical form of this configuration is <code>"without"</code>. To convert the canonical
form to the environment variable form, capitalize it, and prepend <code>BUNDLE_</code>. The
environment variable form of <code>"without"</code> is <code>BUNDLE_WITHOUT</code>.</p>
<p>Any periods in the configuration keys must be replaced with two underscores when
setting it via environment variables. The configuration key <code>local.rack</code> becomes
the environment variable <code>BUNDLE_LOCAL__RACK</code>.</p>
<h2 id="LIST-OF-AVAILABLE-KEYS">List Of Available Keys</h2>
<p>The following is a list of all configuration keys and their purpose. You can
learn more about their operation in <a href="bundle-install.1.html">bundle install(1)</a>.</p>
<ul>
<li>
<code>path</code> (<code>BUNDLE_PATH</code>):
The location on disk where all gems in your bundle will be located regardless
of <code>$GEM_HOME</code> or <code>$GEM_PATH</code> values. Bundle gems not found in this location
will be installed by <code>bundle install</code>. Defaults to <code>Gem.dir</code>. When --deployment is
used, defaults to vendor/bundle.</li>
<li>
<code>frozen</code> (<code>BUNDLE_FROZEN</code>):
Disallow changes to the <code>Gemfile</code>. Defaults to <code>true</code> when <code>--deployment</code>
is used.</li>
<li>
<code>without</code> (<code>BUNDLE_WITHOUT</code>):
A <code>:</code>-separated list of groups whose gems bundler should not install</li>
<li>
<code>bin</code> (<code>BUNDLE_BIN</code>):
Install executables from gems in the bundle to the specified directory.
Defaults to <code>false</code>.</li>
<li>
<code>gemfile</code> (<code>BUNDLE_GEMFILE</code>):
The name of the file that bundler should use as the <code>Gemfile</code>. This location
of this file also sets the root of the project, which is used to resolve
relative paths in the <code>Gemfile</code>, among other things. By default, bundler
will search up from the current working directory until it finds a
<code>Gemfile</code>.</li>
<li>
<code>ssl_ca_cert</code> (<code>BUNDLE_SSL_CA_CERT</code>):
Path to a designated CA certificate file or folder containing multiple
certificates for trusted CAs in PEM format.</li>
<li>
<code>ssl_client_cert</code> (<code>BUNDLE_SSL_CLIENT_CERT</code>):
Path to a designated file containing a X.509 client certificate
and key in PEM format.</li>
<li>
<code>cache_path</code> (<code>BUNDLE_CACHE_PATH</code>): The directory that bundler will place
cached gems in when running <code>bundle package</code>, and that bundler
will look in when installing gems.</li>
<li>
<code>disable_multisource</code> (<code>BUNDLE_DISABLE_MULTISOURCE</code>): When set, Gemfiles
containing multiple sources will produce errors instead of warnings. Use
<code>bundle config --delete disable_multisource</code> to unset.</li>
<li>
<code>ignore_messages</code> (<code>BUNDLE_IGNORE_MESSAGES</code>): When set, no post install
messages will be printed. To silence a single gem, use dot notation like
<code>ignore_messages.httparty true</code>.</li>
<li>
<code>retry</code> (<code>BUNDLE_RETRY</code>):
The number of times to retry failed network requests. Defaults to <code>3</code>.</li>
<li>
<code>redirect</code> (<code>BUNDLE_REDIRECT</code>):
The number of redirects allowed for network requests. Defaults to <code>5</code>.</li>
<li>
<code>timeout</code> (<code>BUNDLE_TIMEOUT</code>):
The seconds allowed before timing out for network requests. Defaults to <code>10</code>.</li>
</ul>
<p>In general, you should set these settings per-application by using the applicable
flag to the <a href="bundle-install.1.html">bundle install(1)</a> or <a href="bundle-package.1.html">bundle package(1)</a> command.</p>
<p>You can set them globally either via environment variables or <code>bundle config</code>,
whichever is preferable for your setup. If you use both, environment variables
will take preference over global settings.</p>
<h2 id="LOCAL-GIT-REPOS">Local Git Repos</h2>
<p>Bundler also allows you to work against a git repository locally
instead of using the remote version. This can be achieved by setting
up a local override:</p>
<pre><code>bundle config local.GEM_NAME /path/to/local/git/repository
</code></pre>
<p>For example, in order to use a local Rack repository, a developer could call:</p>
<pre><code>bundle config local.rack ~/Work/git/rack
</code></pre>
<p>Now instead of checking out the remote git repository, the local
override will be used. Similar to a path source, every time the local
git repository change, changes will be automatically picked up by
Bundler. This means a commit in the local git repo will update the
revision in the <code>Gemfile.lock</code> to the local git repo revision. This
requires the same attention as git submodules. Before pushing to
the remote, you need to ensure the local override was pushed, otherwise
you may point to a commit that only exists in your local machine.</p>
<p>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 <code>Gemfile</code> in order to use this feature. If the branch
specified in the <code>Gemfile</code> 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.</p>
<p>Finally, Bundler also ensures that the current revision in the
<code>Gemfile.lock</code> exists in the local git repository. By doing this, Bundler
forces you to fetch the latest changes in the remotes.</p>
<h2 id="MIRRORS-OF-GEM-SOURCES">Mirrors Of Gem Sources</h2>
<p>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.</p>
<pre><code>bundle config mirror.SOURCE_URL MIRROR_URL
</code></pre>
<p>For example, to use a mirror of rubygems.org hosted at</p>
<pre><code>bundle config mirror.http://rubygems.org http://rubygems-mirror.org
</code></pre>
<h2 id="CREDENTIALS-FOR-GEM-SOURCES">Credentials For Gem Sources</h2>
<p>Bundler allows you to configure credentials for any gem source, which allows
you to avoid putting secrets into your Gemfile.</p>
<pre><code>bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
</code></pre>
<p>For example, to save the credentials of user <code>claudette</code> for the gem source at
<code>gems.longerous.com</code>, you would run:</p>
<pre><code>bundle config gems.longerous.com claudette:s00pers3krit
</code></pre>
<p>Or you can set the credentials as an environment variable like this:</p>
<pre><code>export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
</code></pre>
</div>
</div>
<div class='col-12 col-md-3 mt-4' id='sidebar-wrapper'>
<div class='sidebar-nav'>
<h4>Choose version</h4>
<select class='version-selects form-select mb-3'>
<optgroup label='Current release'>
<option value='/v2.3/bundle_config.html'>
v2.3
</option>
</optgroup>
<optgroup label='Legacy release'>
<option value='/v2.2/bundle_config.html'>
v2.2
</option>
<option value='/v2.1/bundle_config.html'>
v2.1
</option>
</optgroup>
<optgroup label='Deprecated release'>
<option value='/v2.0/bundle_config.html'>
v2.0
</option>
<option value='/v1.17/bundle_config.html'>
v1.17
</option>
<option value='/v1.16/bundle_config.html'>
v1.16
</option>
<option value='/v1.15/bundle_config.html'>
v1.15
</option>
<option value='/v1.14/bundle_config.html'>
v1.14
</option>
<option selected value='/v1.13/bundle_config.html'>
v1.13
</option>
<option value='/v1.12/bundle_config.html'>
v1.12
</option>
</optgroup>
</select>
<h4>Primary Commands</h4>
<ul>
<li class=''>
<a href="/v1.13/man/bundle-install.1.html">bundle install</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-update.1.html">bundle update</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-exec.1.html">bundle exec</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-config.1.html">bundle config</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_help.html">bundle help</a>
</li>
<li class='separator'>
<hr>
</li>
</ul>
<h4>Utilities</h4>
<ul>
<li class=''>
<a href="/v1.13/man/bundle.1.html">bundle</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-binstubs.1.html">bundle binstubs</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_check.html">bundle check</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_clean.html">bundle clean</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_console.html">bundle console</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-gem.1.html">bundle gem</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_init.html">bundle init</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_inject.html">bundle inject</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-lock.1.html">bundle lock</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_open.html">bundle open</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_outdated.html">bundle outdated</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-package.1.html">bundle package</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/bundle-platform.1.html">bundle platform</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_show.html">bundle show</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_version.html">bundle version</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/bundle_viz.html">bundle viz</a>
</li>
<li class='separator'>
<hr>
</li>
<li class=''>
<a href="/v1.13/man/gemfile.5.html">gemfile</a>
</li>
<li class='separator'>
<hr>
</li>
</ul>
</div>
</div>
</div>
</div>
<script src="/commands_layout.min.js"></script>
<div class='bg-light-blue'>
<div class='container'>
<div class='contents'>
<div class='edit-on-github text-center'>
This document is obsolete. <a href="/v2.3/man/bundle-config.1.html">See the latest version of this document</a> if you caught an error or noticed something was missing, it may be fixed there.
</div>
</div>
</div>
</div>
<div class='footer'>
<nav class='navbar justify-content-center'>
<ul class='navbar-nav'>
<li class='nav-item'><a href="/docs.html" class="nav-link px-3">Docs</a></li>
<li class='nav-item'><a href="/contributors.html" class="nav-link px-3">Team</a></li>
<li class='nav-item'><a href="/blog" class="nav-link px-3">Blog</a></li>
<li class='nav-item'><a href="/about.html" class="nav-link px-3">About</a></li>
<li class='nav-item'><a href="https://github.com/rubygems/rubygems/tree/master/bundler" class="nav-link px-3">Repository</a></li>
</ul>
</nav>
</div>
</body>
</html>