1BUNDLE-UPDATE(1)                                              BUNDLE-UPDATE(1)
2
3
4

NAME

6       bundle-update - Update your gems to the latest available versions
7

SYNOPSIS

9       bundle update *gems [--source=NAME] [--local]
10

DESCRIPTION

12       Update  the  gems specified (all gems, if none are specified), ignoring
13       the previously installed gems specified in the  Gemfile.lock.  In  gen‐
14       eral, you should use bundle install(1) bundle-install.1.html to install
15       the same exact gems and versions across machines.
16
17       You would use bundle update to explicitly update the version of a gem.
18

OPTIONS

20       --source=<name>
21              The name of a :git or :path source used in the  Gemfile(5).  For
22              instance,        with        a        :git       source       of
23              http://github.com/rails/rails.git, you would call bundle  update
24              --source rails
25
26       --local
27              Do  not  attempt  to  fetch  gems remotely and use the gem cache
28              instead.
29

UPDATING ALL GEMS

31       If you run bundle update with no parameters, bundler  will  ignore  any
32       previously  installed  gems and resolve all dependencies again based on
33       the latest versions of all gems available in the sources.
34
35       Consider the following Gemfile(5):
36
37
38
39           source "https://rubygems.org"
40
41           gem "rails", "3.0.0.rc"
42           gem "nokogiri"
43
44
45
46       When you run bundle install(1) bundle-install.1.html  the  first  time,
47       bundler  will  resolve  all  of the dependencies, all the way down, and
48       install what you need:
49
50
51
52           Fetching source index for https://rubygems.org/
53           Installing rake (10.0.2)
54           Installing abstract (1.0.0)
55           Installing activesupport (3.0.0.rc)
56           Installing builder (2.1.2)
57           Installing i18n (0.4.1)
58           Installing activemodel (3.0.0.rc)
59           Installing erubis (2.6.6)
60           Installing rack (1.2.1)
61           Installing rack-mount (0.6.9)
62           Installing rack-test (0.5.4)
63           Installing tzinfo (0.3.22)
64           Installing actionpack (3.0.0.rc)
65           Installing mime-types (1.16)
66           Installing polyglot (0.3.1)
67           Installing treetop (1.4.8)
68           Installing mail (2.2.5)
69           Installing actionmailer (3.0.0.rc)
70           Installing arel (0.4.0)
71           Installing activerecord (3.0.0.rc)
72           Installing activeresource (3.0.0.rc)
73           Installing bundler (1.0.0.rc.3)
74           Installing nokogiri (1.4.3.1) with native extensions
75           Installing thor (0.14.0)
76           Installing railties (3.0.0.rc)
77           Installing rails (3.0.0.rc)
78
79           Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
80
81
82
83       As you can see, even though you have just two gems in  the  Gemfile(5),
84       your  application  actually  needs  25  different gems in order to run.
85       Bundler remembers the exact versions it installed in Gemfile.lock.  The
86       next  time  you  run  bundle  install(1) bundle-install.1.html, bundler
87       skips the dependency resolution  and  installs  the  same  gems  as  it
88       installed last time.
89
90       After  checking in the Gemfile.lock into version control and cloning it
91       on another machine,  running  bundle  install(1)  bundle-install.1.html
92       will  still  install  the  gems that you installed last time. You don´t
93       need to worry that a new release of erubis or mail changes the gems you
94       use.
95
96       However,  from  time to time, you might want to update the gems you are
97       using to the newest versions that still match the  gems  in  your  Gem‐
98       file(5).
99
100       To  do this, run bundle update, which will ignore the Gemfile.lock, and
101       resolve all the dependencies again. Keep in mind that this process  can
102       result  in  a  significantly different set of the 25 gems, based on the
103       requirements of new gems that the gem authors released since  the  last
104       time you ran bundle update.
105

UPDATING A LIST OF GEMS

107       Sometimes, you want to update a single gem in the Gemfile(5), and leave
108       the rest of the gems that you specified locked to the versions  in  the
109       Gemfile.lock.
110
111       For  instance,  in  the  scenario above, imagine that nokogiri releases
112       version 1.4.4, and you want to update it without updating Rails and all
113       of its dependencies. To do this, run bundle update nokogiri.
114
115       Bundler  will  update  nokogiri  and any of its dependencies, but leave
116       alone Rails and its dependencies.
117

OVERLAPPING DEPENDENCIES

119       Sometimes, multiple gems declared in your Gemfile(5) are  satisfied  by
120       the  same  second-level  dependency. For instance, consider the case of
121       thin and rack-perftools-profiler.
122
123
124
125           source "https://rubygems.org"
126
127           gem "thin"
128           gem "rack-perftools-profiler"
129
130
131
132       The thin gem depends on  rack  >=  1.0,  while  rack-perftools-profiler
133       depends on rack ~> 1.0. If you run bundle install, you get:
134
135
136
137           Fetching source index for https://rubygems.org/
138           Installing daemons (1.1.0)
139           Installing eventmachine (0.12.10) with native extensions
140           Installing open4 (1.0.1)
141           Installing perftools.rb (0.4.7) with native extensions
142           Installing rack (1.2.1)
143           Installing rack-perftools_profiler (0.0.2)
144           Installing thin (1.2.7) with native extensions
145           Using bundler (1.0.0.rc.3)
146
147
148
149       In this case, the two gems have their own set of dependencies, but they
150       share rack in common. If you  run  bundle  update  thin,  bundler  will
151       update  daemons, eventmachine and rack, which are dependencies of thin,
152       but  not   open4   or   perftools.rb,   which   are   dependencies   of
153       rack-perftools_profiler.  Note that bundle update thin will update rack
154       even though it´s also a dependency of rack-perftools_profiler.
155
156       In short, when you update a  gem  using  bundle  update,  bundler  will
157       update  all  dependencies  of  that  gem, including those that are also
158       dependencies of another gem.
159
160       In this scenario, updating the thin version manually in the Gemfile(5),
161       and  then  running  bundle  install(1)  bundle-install.1.html will only
162       update daemons and eventmachine, but not rack.  For  more  information,
163       see  the  CONSERVATIVE  UPDATING  section  of  bundle  install(1)  bun‐
164       dle-install.1.html.
165
167       In general, when working with an application managed with bundler,  you
168       should use the following workflow:
169
170       ·   After you create your Gemfile(5) for the first time, run
171
172           $ bundle install
173
174       ·   Check the resulting Gemfile.lock into version control
175
176           $ git add Gemfile.lock
177
178       ·   When  checking  out this repository on another development machine,
179           run
180
181           $ bundle install
182
183       ·   When checking out this repository on a deployment machine, run
184
185           $ bundle install --deployment
186
187       ·   After changing the Gemfile(5) to reflect a  new  or  update  depen‐
188           dency, run
189
190           $ bundle install
191
192       ·   Make sure to check the updated Gemfile.lock into version control
193
194           $ git add Gemfile.lock
195
196       ·   If bundle install(1) bundle-install.1.html reports a conflict, man‐
197           ually update the specific gems that you changed in the Gemfile(5)
198
199           $ bundle update rails thin
200
201       ·   If you want to update all the gems to the latest possible  versions
202           that still match the gems listed in the Gemfile(5), run
203
204           $ bundle update
205
206
207
208
209
210
211                                 December 2014                BUNDLE-UPDATE(1)
Impressum