Bundler

Description

Bundleropen in new window allows you to specify which gems your application depends upon, and optionally which version those gems should be. Once this specification is in place, Bundleropen in new window installs all required gems (including the full gem dependency tree) and logs the results for later inspection. By default, Bundler installs gems into a shared location, but they can also be installed directly into your application. When your application is run, Bundler provides the correct version of each gem, even if multiple versions of each gem have been installed.

Usage

First of all, Bundleropen in new window is a gem itself, you can install it by running:

    gem install bundler
1

Then, in the root of your project run:

    gem install bundler
1

It will create a file named Gemfileopen in new window. This will declare what gems you need for this project. A Gemfileopen in new window describes the gem dependencies required to execute associated Ruby code.

The first line(s) of your Gemfile will tell Bundler where to get your gems. Gems live in online repositories, so it will need to know where to get them. Most of the time, just using rubygems.org as your source will be sufficient, but you can have multiple sources if you want.

    source "http;//rubygems.org"
1

Then, just list your gems like this:

    gem "fastlane"
	gem "cocoapods"
	gem "xcode-install"
	gem "xcov"
	gem "danger-gitlab"
	gem 'danger-swiftlint'
	gem 'fastlane-plugin-badge'
1
2
3
4
5
6
7

Run the following to install the dependencies specified in your Gemfileopen in new window:

    bundle install
1

When you run bundle install, Bundleropen in new window will persist the full names and versions of all gems that you used (including dependencies of the gems specified in the Gemfile(5)) into a file called Gemfile.lock

Install the gems specified in your Gemfileopen in new window. If this is the first time you run bundle install (and a Gemfile.lock does not exist), Bundleropen in new window will fetch all remote sources, resolve dependencies and install all needed gems.

If a Gemfile.lock does exist, and you have not updated your Gemfileopen in new window, Bundleropen in new window will fetch all remote sources, but use the dependencies specified in the Gemfile.lock instead of resolving dependencies.

If a Gemfile.lock does exist, and you have updated your Gemfileopen in new window, Bundleropen in new window will use the dependencies in the Gemfile.lock for all gems that you did not update, but will re-resolve the dependencies of gems that you did update.

Don't forget to update your gems to the latest available versions:

    bundle update
1

Update the gems specified (all gems, if none are specified), ignoring the previously installed gems specified in the Gemfile.lock. In general, you should use bundle install to install the same exact gems and versions across machines.

You would use bundle update to explicitly update the version of a gem.