bundler 1.0.0.rc.5 → 1.0.0.rc.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- data/CHANGELOG.md +18 -0
- data/ISSUES.md +30 -0
- data/README.md +3 -64
- data/lib/bundler.rb +33 -5
- data/lib/bundler/capistrano.rb +26 -5
- data/lib/bundler/cli.rb +41 -1
- data/lib/bundler/dsl.rb +1 -0
- data/lib/bundler/gem_helper.rb +18 -26
- data/lib/bundler/man/bundle +96 -0
- data/lib/bundler/man/bundle-config +92 -0
- data/lib/bundler/man/bundle-config.txt +108 -0
- data/lib/bundler/man/bundle-exec +107 -0
- data/lib/bundler/man/bundle-exec.txt +115 -0
- data/lib/bundler/man/bundle-install +280 -0
- data/lib/bundler/man/bundle-install.txt +331 -0
- data/lib/bundler/man/bundle-package +49 -0
- data/lib/bundler/man/bundle-package.txt +66 -0
- data/lib/bundler/man/bundle-update +202 -0
- data/lib/bundler/man/bundle-update.txt +207 -0
- data/lib/bundler/man/bundle.txt +83 -0
- data/lib/bundler/man/gemfile.5 +343 -0
- data/lib/bundler/man/gemfile.5.txt +317 -0
- data/lib/bundler/source.rb +4 -25
- data/lib/bundler/templates/Executable +1 -1
- data/lib/bundler/templates/Gemfile +2 -2
- data/lib/bundler/templates/newgem/Gemfile.tt +1 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +2 -1
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +7 -3
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -3
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +3 -4
- data/lib/bundler/vendor/thor/parser/options.rb +9 -1
- data/lib/bundler/vendor/thor/shell.rb +1 -1
- data/lib/bundler/vendor/thor/util.rb +2 -2
- data/lib/bundler/version.rb +1 -1
- metadata +22 -48
- data/TODO.md +0 -13
- data/bin/bundle.compiled.rbc +0 -486
- data/lib/bundler.rbc +0 -5691
- data/lib/bundler/cli.rbc +0 -10105
- data/lib/bundler/definition.rbc +0 -9423
- data/lib/bundler/dependency.rbc +0 -2650
- data/lib/bundler/dsl.rbc +0 -5861
- data/lib/bundler/environment.rbc +0 -923
- data/lib/bundler/index.rbc +0 -0
- data/lib/bundler/installer.rbc +0 -1634
- data/lib/bundler/lazy_specification.rbc +0 -1721
- data/lib/bundler/lockfile_parser.rbc +0 -2524
- data/lib/bundler/remote_specification.rbc +0 -1058
- data/lib/bundler/resolver.rbc +0 -9067
- data/lib/bundler/rubygems_ext.rbc +0 -4490
- data/lib/bundler/runtime.rbc +0 -3350
- data/lib/bundler/settings.rbc +0 -2951
- data/lib/bundler/shared_helpers.rbc +0 -3614
- data/lib/bundler/source.rbc +0 -15697
- data/lib/bundler/spec_set.rbc +0 -3394
- data/lib/bundler/ui.rbc +0 -1407
- data/lib/bundler/vendor/thor.rbc +0 -5037
- data/lib/bundler/vendor/thor/actions.rbc +0 -4782
- data/lib/bundler/vendor/thor/actions/create_file.rbc +0 -1672
- data/lib/bundler/vendor/thor/actions/directory.rbc +0 -1477
- data/lib/bundler/vendor/thor/actions/empty_directory.rbc +0 -1773
- data/lib/bundler/vendor/thor/actions/file_manipulation.rbc +0 -2877
- data/lib/bundler/vendor/thor/actions/inject_into_file.rbc +0 -1764
- data/lib/bundler/vendor/thor/base.rbc +0 -7795
- data/lib/bundler/vendor/thor/core_ext/file_binary_read.rbc +0 -271
- data/lib/bundler/vendor/thor/core_ext/hash_with_indifferent_access.rbc +0 -1395
- data/lib/bundler/vendor/thor/core_ext/ordered_hash.rbc +0 -1862
- data/lib/bundler/vendor/thor/error.rbc +0 -240
- data/lib/bundler/vendor/thor/invocation.rbc +0 -2050
- data/lib/bundler/vendor/thor/parser.rbc +0 -101
- data/lib/bundler/vendor/thor/parser/argument.rbc +0 -1445
- data/lib/bundler/vendor/thor/parser/arguments.rbc +0 -2661
- data/lib/bundler/vendor/thor/parser/option.rbc +0 -2007
- data/lib/bundler/vendor/thor/parser/options.rbc +0 -3429
- data/lib/bundler/vendor/thor/shell.rbc +0 -1486
- data/lib/bundler/vendor/thor/shell/basic.rbc +0 -4872
- data/lib/bundler/vendor/thor/shell/color.rbc +0 -1659
- data/lib/bundler/vendor/thor/task.rbc +0 -2900
- data/lib/bundler/vendor/thor/util.rbc +0 -3196
- data/lib/bundler/version.rbc +0 -175
@@ -0,0 +1,331 @@
|
|
1
|
+
BUNDLE-INSTALL(1) BUNDLE-INSTALL(1)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
NAME
|
6
|
+
bundle-install - Install the dependencies specified in your Gemfile
|
7
|
+
|
8
|
+
SYNOPSIS
|
9
|
+
bundle install [--local] [--quiet] [--gemfile=GEMFILE] [--system]
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
[--deployment] [--frozen] [--path]
|
14
|
+
[--binstubs[=DIRECTORY]] [--without=GROUP1[ GROUP2...]]
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
DESCRIPTION
|
19
|
+
Install the gems specified in your Gemfile(5). If this is the first
|
20
|
+
time you run bundle install (and a Gemfile.lock does not exist),
|
21
|
+
bundler will fetch all remote sources, resolve dependencies and install
|
22
|
+
all needed gems.
|
23
|
+
|
24
|
+
If a Gemfile.lock does exist, and you have not updated your Gemfile(5),
|
25
|
+
bundler will fetch all remote sources, but use the dependencies speci-
|
26
|
+
fied in the Gemfile.lock instead of resolving dependencies.
|
27
|
+
|
28
|
+
If a Gemfile.lock does exist, and you have updated your Gemfile(5),
|
29
|
+
bundler will use the dependencies in the Gemfile.lock for all gems that
|
30
|
+
you did not update, but will re-resolve the dependencies of gems that
|
31
|
+
you did update. You can find more information about this update process
|
32
|
+
below under CONSERVATIVE UPDATING.
|
33
|
+
|
34
|
+
OPTIONS
|
35
|
+
--gemfile=<gemfile>
|
36
|
+
The location of the Gemfile(5) that bundler should use. This
|
37
|
+
defaults to a gemfile in the current working directory. In gen-
|
38
|
+
eral, bundler will assume that the location of the Gemfile(5) is
|
39
|
+
also the project root, and will look for the Gemfile.lock and
|
40
|
+
vendor/cache relative to it.
|
41
|
+
|
42
|
+
--path=<path>
|
43
|
+
The location to install the gems in the bundle to. This defaults
|
44
|
+
to the gem home, which is the location that gem install installs
|
45
|
+
gems to. This means that, by default, gems installed without a
|
46
|
+
--path setting will show up in gem list. This setting is a
|
47
|
+
remembered option.
|
48
|
+
|
49
|
+
--system
|
50
|
+
Installs the gems in the bundle to the system location. This
|
51
|
+
overrides any previous remembered use of --path.
|
52
|
+
|
53
|
+
--without=<list>
|
54
|
+
A space-separated list of groups to skip installing. This is a
|
55
|
+
remembered option.
|
56
|
+
|
57
|
+
--local
|
58
|
+
Do not attempt to connect to rubygems.org, instead using just
|
59
|
+
the gems located in vendor/cache. Note that if a more appropri-
|
60
|
+
ate platform-specific gem exists on rubygems.org, this will
|
61
|
+
bypass the normal lookup.
|
62
|
+
|
63
|
+
--deployment
|
64
|
+
Switches bundler's defaults into deployment mode.
|
65
|
+
|
66
|
+
--binstubs[=<directory>]
|
67
|
+
Create a directory (defaults to bin) containing an executable
|
68
|
+
that runs in the context of the bundle. For instance, if the
|
69
|
+
rails gem comes with a rails executable, this flag will create a
|
70
|
+
bin/rails executable that ensures that all dependencies used
|
71
|
+
come from the bundled gems.
|
72
|
+
|
73
|
+
DEPLOYMENT MODE
|
74
|
+
Bundler's defaults are optimized for development. To switch to defaults
|
75
|
+
optimized for deployment, use the --deployment flag.
|
76
|
+
|
77
|
+
1. A Gemfile.lock is required.
|
78
|
+
|
79
|
+
To ensure that the same versions of the gems you developed with and
|
80
|
+
tested with are also used in deployments, a Gemfile.lock is
|
81
|
+
required.
|
82
|
+
|
83
|
+
This is mainly to ensure that you remember to check your Gem-
|
84
|
+
file.lock into version control.
|
85
|
+
|
86
|
+
2. The Gemfile.lock must be up to date
|
87
|
+
|
88
|
+
In development, you can modify your Gemfile(5) and re-run bundle
|
89
|
+
install to conservatively update your Gemfile.lock snapshot.
|
90
|
+
|
91
|
+
In deployment, your Gemfile.lock should be up-to-date with changes
|
92
|
+
made in your Gemfile(5).
|
93
|
+
|
94
|
+
3. Gems are installed to vendor/bundle not your default system loca-
|
95
|
+
tion
|
96
|
+
|
97
|
+
In development, it's convenient to share the gems used in your
|
98
|
+
application with other applications and other scripts run on the
|
99
|
+
system.
|
100
|
+
|
101
|
+
In deployment, isolation is a more important default. In addition,
|
102
|
+
the user deploying the application may not have permission to
|
103
|
+
install gems to the system, or the web server may not have permis-
|
104
|
+
sion to read them.
|
105
|
+
|
106
|
+
As a result, bundle install --deployment installs gems to the ven-
|
107
|
+
dor/bundle directory in the application. This may be overridden
|
108
|
+
using the --path option.
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
SUDO USAGE
|
113
|
+
By default, bundler installs gems to the same location as gem install.
|
114
|
+
|
115
|
+
In some cases, that location may not be writable by your Unix user. In
|
116
|
+
that case, bundler will stage everything in a temporary directory, then
|
117
|
+
ask you for your sudo password in order to copy the gems into their
|
118
|
+
system location.
|
119
|
+
|
120
|
+
From your perspective, this is identical to installing them gems
|
121
|
+
directly into the system.
|
122
|
+
|
123
|
+
You should never use sudo bundle install. This is because several other
|
124
|
+
steps in bundle install must be performed as the current user:
|
125
|
+
|
126
|
+
o Updating your Gemfile.lock
|
127
|
+
|
128
|
+
o Updating your vendor/cache, if necessary
|
129
|
+
|
130
|
+
o Checking out private git repositories using your user's SSH keys
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
Of these three, the first two could theoretically be performed by
|
135
|
+
chowning the resulting files to $SUDO_USER. The third, however, can
|
136
|
+
only be performed by actually invoking the git command as the current
|
137
|
+
user.
|
138
|
+
|
139
|
+
As a result, you should run bundle install as the current user, and
|
140
|
+
bundler will ask for your password if it is needed to perform the final
|
141
|
+
step.
|
142
|
+
|
143
|
+
INSTALLING GROUPS
|
144
|
+
By default, bundle install will install all gems in all groups in your
|
145
|
+
Gemfile(5), except those declared for a different platform.
|
146
|
+
|
147
|
+
However, you can explicitly tell bundler to skip installing certain
|
148
|
+
groups with the --without option. This option takes a space-separated
|
149
|
+
list of groups.
|
150
|
+
|
151
|
+
While the --without option will skip installing the gems in the speci-
|
152
|
+
fied groups, it will still download those gems and use them to resolve
|
153
|
+
the dependencies of every gem in your Gemfile(5).
|
154
|
+
|
155
|
+
This is so that installing a different set of groups on another machine
|
156
|
+
(such as a production server) will not change the gems and versions
|
157
|
+
that you have already developed and tested against.
|
158
|
+
|
159
|
+
Bundler offers a rock-solid guarantee that the third-party code you are
|
160
|
+
running in development and testing is also the third-party code you are
|
161
|
+
running in production. You can choose to exclude some of that code in
|
162
|
+
different environments, but you will never be caught flat-footed by
|
163
|
+
different versions of third-party code being used in different environ-
|
164
|
+
ments.
|
165
|
+
|
166
|
+
For a simple illustration, consider the following Gemfile(5):
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
source "http://rubygems.org"
|
171
|
+
|
172
|
+
gem "sinatra"
|
173
|
+
|
174
|
+
group :production do
|
175
|
+
gem "rack-perftools-profiler"
|
176
|
+
end
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
In this case, sinatra depends on any version of Rack (>= 1.0, while
|
181
|
+
rack-perftools-profiler depends on 1.x (~> 1.0).
|
182
|
+
|
183
|
+
When you run bundle install --without production in development, we
|
184
|
+
look at the dependencies of rack-perftools-profiler as well. That way,
|
185
|
+
you do not spend all your time developing against Rack 2.0, using new
|
186
|
+
APIs unavailable in Rack 1.x, only to have bundler switch to Rack 1.2
|
187
|
+
when the production group is used.
|
188
|
+
|
189
|
+
This should not cause any problems in practice, because we do not
|
190
|
+
attempt to install the gems in the excluded groups, and only evaluate
|
191
|
+
as part of the dependency resolution process.
|
192
|
+
|
193
|
+
This also means that you cannot include different versions of the same
|
194
|
+
gem in different groups, because doing so would result in different
|
195
|
+
sets of dependencies used in development and production. Because of the
|
196
|
+
vagaries of the dependency resolution process, this usually affects
|
197
|
+
more than just the gems you list in your Gemfile(5), and can (surpris-
|
198
|
+
ingly) radically change the gems you are using.
|
199
|
+
|
200
|
+
REMEMBERED OPTIONS
|
201
|
+
Some options (marked above in the OPTIONS section) are remembered
|
202
|
+
between calls to bundle install, and by the Bundler runtime.
|
203
|
+
|
204
|
+
For instance, if you run bundle install --without test, a subsequent
|
205
|
+
call to bundle install that does not include a --without flag will
|
206
|
+
remember your previous choice.
|
207
|
+
|
208
|
+
In addition, a call to Bundler.setup will not attempt to make the gems
|
209
|
+
in those groups available on the Ruby load path, as they were not
|
210
|
+
installed.
|
211
|
+
|
212
|
+
The settings that are remembered are:
|
213
|
+
|
214
|
+
--deployment
|
215
|
+
At runtime, this remembered setting will also result in Bundler
|
216
|
+
raising an exception if the Gemfile.lock is out of date.
|
217
|
+
|
218
|
+
--path Subsequent calls to bundle install will install gems to the
|
219
|
+
directory originally passed to --path. The Bundler runtime will
|
220
|
+
look for gems in that location. You can revert this option by
|
221
|
+
running bundle install --system.
|
222
|
+
|
223
|
+
--binstubs
|
224
|
+
Bundler will update the executables every subsequent call to
|
225
|
+
bundle install.
|
226
|
+
|
227
|
+
--without
|
228
|
+
As described above, Bundler will skip the gems specified by
|
229
|
+
--without in subsequent calls to bundle install. The Bundler
|
230
|
+
runtime will also not try to make the gems in the skipped groups
|
231
|
+
available.
|
232
|
+
|
233
|
+
THE GEMFILE.LOCK
|
234
|
+
When you run bundle install, Bundler will persist the full names and
|
235
|
+
versions of all gems that you used (including dependencies of the gems
|
236
|
+
specified in the Gemfile(5)) into a file called Gemfile.lock.
|
237
|
+
|
238
|
+
Bundler uses this file in all subsequent calls to bundle install, which
|
239
|
+
guarantees that you always use the same exact code, even as your appli-
|
240
|
+
cation moves across machines.
|
241
|
+
|
242
|
+
Because of the way dependency resolution works, even a seemingly small
|
243
|
+
change (for instance, an update to a point-release of a dependency of a
|
244
|
+
gem in your Gemfile(5)) can result in radically different gems being
|
245
|
+
needed to satisfy all dependencies.
|
246
|
+
|
247
|
+
As a result, you SHOULD check your Gemfile.lock into version control.
|
248
|
+
If you do not, every machine that checks out your repository (including
|
249
|
+
your production server) will resolve all dependencies again, which will
|
250
|
+
result in different versions of third-party code being used if any of
|
251
|
+
the gems in the Gemfile(5) or any of their dependencies have been
|
252
|
+
updated.
|
253
|
+
|
254
|
+
CONSERVATIVE UPDATING
|
255
|
+
When you make a change to the Gemfile(5) and then run bundle install,
|
256
|
+
Bundler will update only the gems that you modified.
|
257
|
+
|
258
|
+
In other words, if a gem that you did not modify worked before you
|
259
|
+
called bundle install, it will continue to use the exact same versions
|
260
|
+
of all dependencies as it used before the update.
|
261
|
+
|
262
|
+
Let's take a look at an example. Here's your original Gemfile(5):
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
source "http://rubygems.org"
|
267
|
+
|
268
|
+
gem "actionpack", "2.3.8"
|
269
|
+
gem "activemerchant"
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
In this case, both actionpack and activemerchant depend on activesup-
|
274
|
+
port. The actionpack gem depends on activesupport 2.3.8 and rack ~>
|
275
|
+
1.1.0, while the activemerchant gem depends on activesupport >= 2.3.2,
|
276
|
+
braintree >= 2.0.0, and builder >= 2.0.0.
|
277
|
+
|
278
|
+
When the dependencies are first resolved, Bundler will select
|
279
|
+
activesupport 2.3.8, which satisfies the requirements of both gems in
|
280
|
+
your Gemfile(5).
|
281
|
+
|
282
|
+
Next, you modify your Gemfile(5) to:
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
source "http://rubygems.org"
|
287
|
+
|
288
|
+
gem "actionpack", "3.0.0.rc"
|
289
|
+
gem "activemerchant"
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
The actionpack 3.0.0.rc gem has a number of new dependencies, and
|
294
|
+
updates the activesupport dependency to = 3.0.0.rc and the rack depen-
|
295
|
+
dency to ~> 1.2.1.
|
296
|
+
|
297
|
+
When you run bundle install, Bundler notices that you changed the
|
298
|
+
actionpack gem, but not the activemerchant gem. It evaluates the gems
|
299
|
+
currently being used to satisfy its requirements:
|
300
|
+
|
301
|
+
activesupport 2.3.8
|
302
|
+
also used to satisfy a dependency in activemerchant, which is
|
303
|
+
not being updated
|
304
|
+
|
305
|
+
rack ~> 1.1.0
|
306
|
+
not currently being used to satify another dependency
|
307
|
+
|
308
|
+
Because you did not explicitly ask to update activemerchant, you would
|
309
|
+
not expect it to suddenly stop working after updating actionpack. How-
|
310
|
+
ever, satisfying the new activesupport 3.0.0.rc dependency of action-
|
311
|
+
pack requires updating one of its dependencies.
|
312
|
+
|
313
|
+
Even though activemerchant declares a very loose dependency that theo-
|
314
|
+
retically matches activesupport 3.0.0.rc, bundler treats gems in your
|
315
|
+
Gemfile(5) that have not changed as an atomic unit together with their
|
316
|
+
dependencies. In this case, the activemerchant dependency is treated as
|
317
|
+
activemerchant 1.7.1 + activesupport 2.3.8, so bundle install will
|
318
|
+
report that it cannot update actionpack.
|
319
|
+
|
320
|
+
To explicitly update actionpack, including its dependencies which other
|
321
|
+
gems in the Gemfile(5) still depend on, run bundle update actionpack
|
322
|
+
(see bundle update(1)).
|
323
|
+
|
324
|
+
Summary: In general, after making a change to the Gemfile(5) , you
|
325
|
+
should first try to run bundle install, which will guarantee that no
|
326
|
+
other gems in the Gemfile(5) are impacted by the change. If that does
|
327
|
+
not work, run bundle update(1) bundle-update.1.html.
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
August 2010 BUNDLE-INSTALL(1)
|
@@ -0,0 +1,49 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "BUNDLE\-PACKAGE" "1" "August 2010" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBbundle\-package\fR \- Package your needed \fB\.gem\fR files into your application
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBbundle package\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
Copy all of the \fB\.gem\fR files needed to run the application into the \fBvendor/cache\fR directory\. In the future, when running bundle install(1) \fIbundle\-install\.1\.html\fR, use the gems in the cache in preference to the ones on \fBrubygems\.org\fR\.
|
14
|
+
.
|
15
|
+
.SH "GIT AND PATH GEMS"
|
16
|
+
In Bundler 1\.0, the \fBbundle package\fR command only packages \fB\.gem\fR files, not gems specified using the \fB:git\fR or \fB:path\fR options\. This will likely change in the future\.
|
17
|
+
.
|
18
|
+
.SH "REMOTE FETCHING"
|
19
|
+
By default, if you simply run bundle install(1) \fIbundle\-install\.1\.html\fR after running bundle package(1) \fIbundle\-package\.1\.html\fR, bundler will still connect to \fBrubygems\.org\fR to check whether a platform\-specific gem exists for any of the gems in \fBvendor/cache\fR\.
|
20
|
+
.
|
21
|
+
.P
|
22
|
+
For instance, consider this Gemfile(5):
|
23
|
+
.
|
24
|
+
.IP "" 4
|
25
|
+
.
|
26
|
+
.nf
|
27
|
+
|
28
|
+
source "http://rubygems\.org"
|
29
|
+
|
30
|
+
gem "nokogiri"
|
31
|
+
.
|
32
|
+
.fi
|
33
|
+
.
|
34
|
+
.IP "" 0
|
35
|
+
.
|
36
|
+
.P
|
37
|
+
If you run \fBbundle package\fR under C Ruby, bundler will retrieve the version of \fBnokogiri\fR for the \fB"ruby"\fR platform\. If you deploy to JRuby and run \fBbundle install\fR, bundler is forced to check to see whether a \fB"java"\fR platformed \fBnokogiri\fR exists\.
|
38
|
+
.
|
39
|
+
.P
|
40
|
+
Even though the \fBnokogiri\fR gem for the Ruby platform is \fItechnically\fR acceptable on JRuby, it actually has a C extension that does not run on JRuby\. As a result, bundler will, by default, still connect to \fBrubygems\.org\fR to check whether it has a version of one of your gems more specific to your platform\.
|
41
|
+
.
|
42
|
+
.P
|
43
|
+
This problem is also not just limited to the \fB"java"\fR 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\.
|
44
|
+
.
|
45
|
+
.P
|
46
|
+
If you know for sure that the gems packaged in \fBvendor/cache\fR are appropriate for the platform you are on, you can run \fBbundle install \-\-local\fR to skip checking for more appropriate gems, and just use the ones in \fBvendor/cache\fR\.
|
47
|
+
.
|
48
|
+
.P
|
49
|
+
One way to be sure that you have the right platformed versions of all your gems is to run \fBbundle package\fR on an identical machine and check in the gems\. For instance, you can run \fBbundle package\fR on an identical staging box during your staging process, and check in the \fBvendor/cache\fR before deploying to production\.
|
@@ -0,0 +1,66 @@
|
|
1
|
+
BUNDLE-PACKAGE(1) BUNDLE-PACKAGE(1)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
NAME
|
6
|
+
bundle-package - Package your needed .gem files into your application
|
7
|
+
|
8
|
+
SYNOPSIS
|
9
|
+
bundle package
|
10
|
+
|
11
|
+
DESCRIPTION
|
12
|
+
Copy all of the .gem files needed to run the application into the ven-
|
13
|
+
dor/cache directory. In the future, when running bundle install(1) bun-
|
14
|
+
dle-install.1.html, use the gems in the cache in preference to the ones
|
15
|
+
on rubygems.org.
|
16
|
+
|
17
|
+
GIT AND PATH GEMS
|
18
|
+
In Bundler 1.0, the bundle package command only packages .gem files,
|
19
|
+
not gems specified using the :git or :path options. This will likely
|
20
|
+
change in the future.
|
21
|
+
|
22
|
+
REMOTE FETCHING
|
23
|
+
By default, if you simply run bundle install(1) bundle-install.1.html
|
24
|
+
after running bundle package(1) bundle-package.1.html, bundler will
|
25
|
+
still connect to rubygems.org to check whether a platform-specific gem
|
26
|
+
exists for any of the gems in vendor/cache.
|
27
|
+
|
28
|
+
For instance, consider this Gemfile(5):
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
source "http://rubygems.org"
|
33
|
+
|
34
|
+
gem "nokogiri"
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
If you run bundle package under C Ruby, bundler will retrieve the ver-
|
39
|
+
sion of nokogiri for the "ruby" platform. If you deploy to JRuby and
|
40
|
+
run bundle install, bundler is forced to check to see whether a "java"
|
41
|
+
platformed nokogiri exists.
|
42
|
+
|
43
|
+
Even though the nokogiri gem for the Ruby platform is technically
|
44
|
+
acceptable on JRuby, it actually has a C extension that does not run on
|
45
|
+
JRuby. As a result, bundler will, by default, still connect to
|
46
|
+
rubygems.org to check whether it has a version of one of your gems more
|
47
|
+
specific to your platform.
|
48
|
+
|
49
|
+
This problem is also not just limited to the "java" platform. A similar
|
50
|
+
(common) problem can happen when developing on Windows and deploying to
|
51
|
+
Linux, or even when developing on OSX and deploying to Linux.
|
52
|
+
|
53
|
+
If you know for sure that the gems packaged in vendor/cache are appro-
|
54
|
+
priate for the platform you are on, you can run bundle install --local
|
55
|
+
to skip checking for more appropriate gems, and just use the ones in
|
56
|
+
vendor/cache.
|
57
|
+
|
58
|
+
One way to be sure that you have the right platformed versions of all
|
59
|
+
your gems is to run bundle package on an identical machine and check in
|
60
|
+
the gems. For instance, you can run bundle package on an identical
|
61
|
+
staging box during your staging process, and check in the vendor/cache
|
62
|
+
before deploying to production.
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
August 2010 BUNDLE-PACKAGE(1)
|
@@ -0,0 +1,202 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "BUNDLE\-UPDATE" "1" "August 2010" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBbundle\-update\fR \- Update your gems to the latest available versions
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBbundle update\fR \fI*gems\fR [\-\-source=NAME]
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
Update the gems specified (all gems, if none are specified), ignoring the previously installed gems specified in the \fBGemfile\.lock\fR\. In general, you should use bundle install(1) \fIbundle\-install\.1\.html\fR to install the same exact gems and versions across machines\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
You would use \fBbundle update\fR to explicitly update the version of a gem\.
|
17
|
+
.
|
18
|
+
.SH "OPTIONS"
|
19
|
+
.
|
20
|
+
.TP
|
21
|
+
\fB\-\-source=<name>\fR
|
22
|
+
The name of a \fB:git\fR or \fB:path\fR source used in the Gemfile(5)\. For instance, with a \fB:git\fR source of \fBhttp://github\.com/rails/rails\.git\fR, you would call \fBbundle update \-\-source rails\fR
|
23
|
+
.
|
24
|
+
.SH "UPDATING ALL GEMS"
|
25
|
+
If you run \fBbundle update\fR with no parameters, bundler will ignore any previously installed gems and resolve all dependencies again based on the latest versions of all gems available in the sources\.
|
26
|
+
.
|
27
|
+
.P
|
28
|
+
Consider the following Gemfile(5):
|
29
|
+
.
|
30
|
+
.IP "" 4
|
31
|
+
.
|
32
|
+
.nf
|
33
|
+
|
34
|
+
source "http://rubygems\.org"
|
35
|
+
|
36
|
+
gem "rails", "3\.0\.0\.rc"
|
37
|
+
gem "nokogiri"
|
38
|
+
.
|
39
|
+
.fi
|
40
|
+
.
|
41
|
+
.IP "" 0
|
42
|
+
.
|
43
|
+
.P
|
44
|
+
When you run bundle install(1) \fIbundle\-install\.1\.html\fR the first time, bundler will resolve all of the dependencies, all the way down, and install what you need:
|
45
|
+
.
|
46
|
+
.IP "" 4
|
47
|
+
.
|
48
|
+
.nf
|
49
|
+
|
50
|
+
Fetching source index for http://rubygems\.org/
|
51
|
+
Installing rake (0\.8\.7)
|
52
|
+
Installing abstract (1\.0\.0)
|
53
|
+
Installing activesupport (3\.0\.0\.rc)
|
54
|
+
Installing builder (2\.1\.2)
|
55
|
+
Installing i18n (0\.4\.1)
|
56
|
+
Installing activemodel (3\.0\.0\.rc)
|
57
|
+
Installing erubis (2\.6\.6)
|
58
|
+
Installing rack (1\.2\.1)
|
59
|
+
Installing rack\-mount (0\.6\.9)
|
60
|
+
Installing rack\-test (0\.5\.4)
|
61
|
+
Installing tzinfo (0\.3\.22)
|
62
|
+
Installing actionpack (3\.0\.0\.rc)
|
63
|
+
Installing mime\-types (1\.16)
|
64
|
+
Installing polyglot (0\.3\.1)
|
65
|
+
Installing treetop (1\.4\.8)
|
66
|
+
Installing mail (2\.2\.5)
|
67
|
+
Installing actionmailer (3\.0\.0\.rc)
|
68
|
+
Installing arel (0\.4\.0)
|
69
|
+
Installing activerecord (3\.0\.0\.rc)
|
70
|
+
Installing activeresource (3\.0\.0\.rc)
|
71
|
+
Installing bundler (1\.0\.0\.rc\.3)
|
72
|
+
Installing nokogiri (1\.4\.3\.1) with native extensions
|
73
|
+
Installing thor (0\.14\.0)
|
74
|
+
Installing railties (3\.0\.0\.rc)
|
75
|
+
Installing rails (3\.0\.0\.rc)
|
76
|
+
|
77
|
+
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed\.
|
78
|
+
.
|
79
|
+
.fi
|
80
|
+
.
|
81
|
+
.IP "" 0
|
82
|
+
.
|
83
|
+
.P
|
84
|
+
As you can see, even though you have just two gems in the Gemfile(5), your application actually needs 25 different gems in order to run\. Bundler remembers the exact versions it installed in \fBGemfile\.lock\fR\. The next time you run bundle install(1) \fIbundle\-install\.1\.html\fR, bundler skips the dependency resolution and installs the same gems as it installed last time\.
|
85
|
+
.
|
86
|
+
.P
|
87
|
+
After checking in the \fBGemfile\.lock\fR into version control and cloning it on another machine, running bundle install(1) \fIbundle\-install\.1\.html\fR will \fIstill\fR install the gems that you installed last time\. You don\'t need to worry that a new release of \fBerubis\fR or \fBmail\fR changes the gems you use\.
|
88
|
+
.
|
89
|
+
.P
|
90
|
+
However, from time to time, you might want to update the gems you are using to the newest versions that still match the gems in your Gemfile(5)\.
|
91
|
+
.
|
92
|
+
.P
|
93
|
+
To do this, run \fBbundle update\fR, which will ignore the \fBGemfile\.lock\fR, and resolve all the dependencies again\. Keep in mind that this process can result in a significantly different set of the 25 gems, based on the requirements of new gems that the gem authors released since the last time you ran \fBbundle update\fR\.
|
94
|
+
.
|
95
|
+
.SH "UPDATING A LIST OF GEMS"
|
96
|
+
Sometimes, you want to update a single gem in the Gemfile(5), and leave the rest of the gems that you specified locked to the versions in the \fBGemfile\.lock\fR\.
|
97
|
+
.
|
98
|
+
.P
|
99
|
+
For instance, in the scenario above, imagine that \fBnokogiri\fR releases version \fB1\.4\.4\fR, and you want to update it \fIwithout\fR updating Rails and all of its dependencies\. To do this, run \fBbundle update nokogiri\fR\.
|
100
|
+
.
|
101
|
+
.P
|
102
|
+
Bundler will update \fBnokogiri\fR and any of its dependencies, but leave alone Rails and its dependencies\.
|
103
|
+
.
|
104
|
+
.SH "OVERLAPPING DEPENDENCIES"
|
105
|
+
Sometimes, multiple gems declared in your Gemfile(5) are satisfied by the same second\-level dependency\. For instance, consider the case of \fBthin\fR and \fBrack\-perftools\-profiler\fR\.
|
106
|
+
.
|
107
|
+
.IP "" 4
|
108
|
+
.
|
109
|
+
.nf
|
110
|
+
|
111
|
+
source "http://rubygems\.org"
|
112
|
+
|
113
|
+
gem "thin"
|
114
|
+
gem "rack\-perftools\-profiler"
|
115
|
+
.
|
116
|
+
.fi
|
117
|
+
.
|
118
|
+
.IP "" 0
|
119
|
+
.
|
120
|
+
.P
|
121
|
+
The \fBthin\fR gem depends on \fBrack >= 1\.0\fR, while \fBrack\-perftools\-profiler\fR depends on \fBrack ~> 1\.0\fR\. If you run bundle install, you get:
|
122
|
+
.
|
123
|
+
.IP "" 4
|
124
|
+
.
|
125
|
+
.nf
|
126
|
+
|
127
|
+
Fetching source index for http://rubygems\.org/
|
128
|
+
Installing daemons (1\.1\.0)
|
129
|
+
Installing eventmachine (0\.12\.10) with native extensions
|
130
|
+
Installing open4 (1\.0\.1)
|
131
|
+
Installing perftools\.rb (0\.4\.7) with native extensions
|
132
|
+
Installing rack (1\.2\.1)
|
133
|
+
Installing rack\-perftools_profiler (0\.0\.2)
|
134
|
+
Installing thin (1\.2\.7) with native extensions
|
135
|
+
Using bundler (1\.0\.0\.rc\.3)
|
136
|
+
.
|
137
|
+
.fi
|
138
|
+
.
|
139
|
+
.IP "" 0
|
140
|
+
.
|
141
|
+
.P
|
142
|
+
In this case, the two gems have their own set of dependencies, but they share \fBrack\fR in common\. If you run \fBbundle update thin\fR, bundler will update \fBdaemons\fR, \fBeventmachine\fR and \fBrack\fR, which are dependencies of \fBthin\fR, but not \fBopen4\fR or \fBperftools\.rb\fR, which are dependencies of \fBrack\-perftools_profiler\fR\. Note that \fBbundle update thin\fR will update \fBrack\fR even though it\'s \fIalso\fR a dependency of \fBrack\-perftools_profiler\fR\.
|
143
|
+
.
|
144
|
+
.P
|
145
|
+
\fBIn short\fR, when you update a gem using \fBbundle update\fR, bundler will update all dependencies of that gem, including those that are also dependencies of another gem\.
|
146
|
+
.
|
147
|
+
.P
|
148
|
+
In this scenario, updating the \fBthin\fR version manually in the Gemfile(5), and then running bundle install(1) \fIbundle\-install\.1\.html\fR will only update \fBdaemons\fR and \fBeventmachine\fR, but not \fBrack\fR\. For more information, see the \fBCONSERVATIVE UPDATING\fR section of bundle install(1) \fIbundle\-install\.1\.html\fR\.
|
149
|
+
.
|
150
|
+
.SH "RECOMMENDED WORKFLOW"
|
151
|
+
In general, when working with an application managed with bundler, you should use the following workflow:
|
152
|
+
.
|
153
|
+
.IP "\(bu" 4
|
154
|
+
After you create your Gemfile(5) for the first time, run
|
155
|
+
.
|
156
|
+
.IP
|
157
|
+
$ bundle install
|
158
|
+
.
|
159
|
+
.IP "\(bu" 4
|
160
|
+
Check the resulting \fBGemfile\.lock\fR into version control
|
161
|
+
.
|
162
|
+
.IP
|
163
|
+
$ git add Gemfile\.lock
|
164
|
+
.
|
165
|
+
.IP "\(bu" 4
|
166
|
+
When checking out this repository on another development machine, run
|
167
|
+
.
|
168
|
+
.IP
|
169
|
+
$ bundle install
|
170
|
+
.
|
171
|
+
.IP "\(bu" 4
|
172
|
+
When checking out this repository on a deployment machine, run
|
173
|
+
.
|
174
|
+
.IP
|
175
|
+
$ bundle install \-\-deployment
|
176
|
+
.
|
177
|
+
.IP "\(bu" 4
|
178
|
+
After changing the Gemfile(5) to reflect a new or update dependency, run
|
179
|
+
.
|
180
|
+
.IP
|
181
|
+
$ bundle install
|
182
|
+
.
|
183
|
+
.IP "\(bu" 4
|
184
|
+
Make sure to check the updated \fBGemfile\.lock\fR into version control
|
185
|
+
.
|
186
|
+
.IP
|
187
|
+
$ git add Gemfile\.lock
|
188
|
+
.
|
189
|
+
.IP "\(bu" 4
|
190
|
+
If bundle install(1) \fIbundle\-install\.1\.html\fR reports a conflict, manually update the specific gems that you changed in the Gemfile(5)
|
191
|
+
.
|
192
|
+
.IP
|
193
|
+
$ bundle update rails thin
|
194
|
+
.
|
195
|
+
.IP "\(bu" 4
|
196
|
+
If you want to update all the gems to the latest possible versions that still match the gems listed in the Gemfile(5), run
|
197
|
+
.
|
198
|
+
.IP
|
199
|
+
$ bundle update
|
200
|
+
.
|
201
|
+
.IP "" 0
|
202
|
+
|