Make sure to add Gemfile.lock to your repository. This will
ensure that other developers on your app, as well as your
deployment environment, use exactly the same third-party code
as you just installed.

Checking Out an Application With a Gemfile for Development

If your system stores its gems in a root-owned location (this
is the default for Mac OSX), bundler will ask you for your
password, so it can install the gems there.

Updating Your Dependencies

Make a change to your Gemfile

# changegem"nokogiri","1.4.2"# togem"nokogiri","1.4.3"

Install the new gems

$ bundle install

After making a change to your Gemfile, the next
bundle install will try to update the gems in
your snapshot (Gemfile.lock) without forcing an
update to any of the other gems in your Gemfile.

This will usually work for simple dependencies, like
nokogiri or sqlite3. On the
other hand, updating Rails will usually require an update
to some other component, because of the amount of dependencies
it has.

If bundler reports a conflict, tell bundler to explicitly update
the gem, but none of the other top-level dependencies (the ones
in your Gemfile)

In some rare cases, bundler will be unable to update the dependency
without updating the top-level dependencies as well. In this case,
tell bundler to update all dependencies

$ bundle update

Deploying Your Application

On production servers, you can enable deployment mode:

$ bundle install --deployment

Do not use this flag on development machines. The
--deployment flag turns on defaults that are appropriate for
a deployment environment. Gems are installed to
vendor/bundle and the Gemfile.lock must be
checked in and up to date before Bundler is run.