Bundler helps in managing gem dependencies of ruby projects. You can specify which gems and versions you need, bundler will install them and load them at runtime. Bundler ensures that gems you need are present in the environment you need.
Bundler gets its configurations from local application
environment variables and user’s home directory
(~/.bundle/config) in the order of priority.
To list all bundler configurations for the current bundle, run bundle config without any parameters. You will also get the location where the value is set.
You might see different result based on configuration of bundler on your machine.
To get value for the specific configuration setting, run bundle config with name.
To set the value of the configuration setting, use bundle config with name and value. Configuration will be stored in
If any config already has a value, it will be overwritten directly and user will be warned.
Application level configuration
By default setting configuration value will set it for all projects on the machine. You can set configurations specific to local application with
--local option. This will store value in
You can run bundle config with
This will set values at global level i.e. across all applications on the machine.
It will be similar to running bundle config without any options.
You can delete configuration with
This is not compatible with
--global. This will delete configuration from local and global resources.
You can pass the flags required for installing particular gem to bundler with bundle config.
Many El Capitan users face an
The issue can be resolved by providing path to OpenSSL include directory while installing
As location of configuration will vary from machine to machine, we can set this with bundle config.
Now bundler will pick this configuration while installing
Various configuration keys are available with bundler.
These keys are available in two forms.
You can specify them in canonical form with
bundle config or set them in environment variable form.
Following are canonical forms and their usage.
Corresponding environment variables are specified in bracket.
Setting auto_install config will enable automatic installing of gems instead of raising an error.
This applies to
Example, When you try to run
bundle show for the gem which is not yet installed you will get an error.
You can set
auto_install to remove this error and install gem.
You can specify location to install your gems. Default path is $GEM_HOME for development and vendor/bundle when –deployment is used.
You can freeze changes to your Gemfile.
If frozen is set and you try to run
bundle install with changed Gemfile, you will get following warning.
You can skip installing groups of gems with bundle install. Specify
: separated group names whose gems bundler should not install.
You can set the directory to install executables from gems in the bundle.
You can set the file which bundler should use as theGemfile. By default, bundler will use
Gemfile. The location of this file also sets the root of the project, which is used to resolve relative paths in the Gemfile.
This specifies path to a designated CA certificate file or folder containing multiple certificates for trusted CAs in PEM format. You can specify your own
https sources in Gemfile with corresponding certificates specified via
This specifies path to a designated file containing a X.509 client certificate and key in PEM format.
You can set the path to place cached gems while running bundle package.
When set, Gemfiles containing multiple sources will produce an error instead of a warning.
When you try to run
bundle install, you will get warning.
To ignore all bundle config on the machine and run bundle install, set
BUNDLE_IGNORE_CONFIG environment variable.