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_package.html
349 lines (312 loc) · 11 KB
/
bundle_package.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
<!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 package
</title>
<link href='/bundle_package.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 package</h2>
<p class="man-name">
<code>bundle-package</code> - <span class="man-whatis">Package your needed <code>.gem</code> files into your application</span>
</p>
<pre><code>bundle package</code></pre>
<h2 id="DESCRIPTION">Description</h2>
<p>Copy all of the <code>.gem</code> files needed to run the application into the
<code>vendor/cache</code> directory. In the future, when running <a href="bundle-install.1.html">bundle install(1)</a>,
use the gems in the cache in preference to the ones on <code>rubygems.org</code>.</p>
<h2 id="GIT-AND-PATH-GEMS">Git And Path Gems</h2>
<p>Since Bundler 1.2, the <code>bundle package</code> command can also package <code>:git</code> and
<code>:path</code> dependencies besides .gem files. This needs to be explicitly enabled
via the <code>--all</code> option. Once used, the <code>--all</code> option will be remembered.</p>
<h2 id="SUPPORT-FOR-MULTIPLE-PLATFORMS">Support For Multiple Platforms</h2>
<p>When using gems that have different packages for different platforms, Bundler
1.8 and newer support caching of gems for other platforms where the Gemfile
has been resolved (i.e. present in the lockfile) in <code>vendor/cache</code>. This needs
to be enabled via the <code>--all-platforms</code> option. This setting will be remembered
in your local bundler configuration.</p>
<h2 id="REMOTE-FETCHING">Remote Fetching</h2>
<p>By default, if you run <a href="bundle-install.1.html">bundle install(1)</a> after running
<a href="bundle-package.1.html">bundle package(1)</a>, bundler will still connect to <code>rubygems.org</code>
to check whether a platform-specific gem exists for any of the gems
in <code>vendor/cache</code>.</p>
<p>For instance, consider this <a class="man-ref" href="gemfile.5.html">Gemfile<span class="s">(5)</span></a>:</p>
<pre><code>source "https://rubygems.org"

gem "nokogiri"
</code></pre>
<p>If you run <code>bundle package</code> under C Ruby, bundler will retrieve
the version of <code>nokogiri</code> for the <code>"ruby"</code> platform. If you deploy
to JRuby and run <code>bundle install</code>, bundler is forced to check to
see whether a <code>"java"</code> platformed <code>nokogiri</code> exists.</p>
<p>Even though the <code>nokogiri</code> gem for the Ruby platform is
<em>technically</em> acceptable on JRuby, it has a C extension
that does not run on JRuby. As a result, bundler will, by default,
still connect to <code>rubygems.org</code> to check whether it has a version
of one of your gems more specific to your platform.</p>
<p>This problem is also not limited to the <code>"java"</code> platform.
A similar (common) problem can happen when developing on Windows
and deploying to Linux, or even when developing on OSX and
deploying to Linux.</p>
<p>If you know for sure that the gems packaged in <code>vendor/cache</code>
are appropriate for the platform you are on, you can run
<code>bundle install --local</code> to skip checking for more appropriate
gems, and use the ones in <code>vendor/cache</code>.</p>
<p>One way to be sure that you have the right platformed versions
of all your gems is to run <code>bundle package</code> on an identical
machine and check in the gems. For instance, you can run
<code>bundle package</code> on an identical staging box during your
staging process, and check in the <code>vendor/cache</code> before
deploying to production.</p>
</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/man/bundle-install.1.html'>
v2.3
</option>
</optgroup>
<optgroup label='Legacy release'>
<option value='/v2.2/man/bundle-install.1.html'>
v2.2
</option>
<option value='/v2.1/bundle_package.html'>
v2.1
</option>
</optgroup>
<optgroup label='Deprecated release'>
<option value='/v2.0/bundle_package.html'>
v2.0
</option>
<option value='/v1.17/bundle_package.html'>
v1.17
</option>
<option value='/v1.16/bundle_package.html'>
v1.16
</option>
<option value='/v1.15/bundle_package.html'>
v1.15
</option>
<option value='/v1.14/bundle_package.html'>
v1.14
</option>
<option selected value='/v1.13/bundle_package.html'>
v1.13
</option>
<option value='/v1.12/bundle_package.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-package.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>