bundler 1.15.4 → 1.16.0.pre.1
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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +43 -0
- data/README.md +12 -7
- data/exe/bundle +1 -1
- data/exe/bundle_ruby +4 -3
- data/lib/bundler.rb +47 -37
- data/lib/bundler/build_metadata.rb +38 -0
- data/lib/bundler/capistrano.rb +5 -0
- data/lib/bundler/cli.rb +155 -67
- data/lib/bundler/cli/add.rb +0 -1
- data/lib/bundler/cli/binstubs.rb +9 -7
- data/lib/bundler/cli/cache.rb +5 -4
- data/lib/bundler/cli/check.rb +3 -5
- data/lib/bundler/cli/clean.rb +5 -6
- data/lib/bundler/cli/common.rb +11 -2
- data/lib/bundler/cli/config.rb +2 -1
- data/lib/bundler/cli/console.rb +2 -1
- data/lib/bundler/cli/doctor.rb +1 -0
- data/lib/bundler/cli/exec.rb +2 -1
- data/lib/bundler/cli/gem.rb +3 -2
- data/lib/bundler/cli/info.rb +0 -1
- data/lib/bundler/cli/init.rb +17 -6
- data/lib/bundler/cli/inject.rb +1 -0
- data/lib/bundler/cli/install.rb +61 -61
- data/lib/bundler/cli/issue.rb +1 -1
- data/lib/bundler/cli/list.rb +22 -0
- data/lib/bundler/cli/lock.rb +0 -1
- data/lib/bundler/cli/open.rb +2 -2
- data/lib/bundler/cli/outdated.rb +13 -8
- data/lib/bundler/cli/package.rb +9 -6
- data/lib/bundler/cli/platform.rb +1 -0
- data/lib/bundler/cli/plugin.rb +1 -0
- data/lib/bundler/cli/pristine.rb +9 -2
- data/lib/bundler/cli/show.rb +0 -1
- data/lib/bundler/cli/update.rb +31 -5
- data/lib/bundler/cli/viz.rb +1 -0
- data/lib/bundler/compact_index_client.rb +1 -0
- data/lib/bundler/compact_index_client/cache.rb +1 -0
- data/lib/bundler/compact_index_client/updater.rb +3 -2
- data/lib/bundler/compatibility_guard.rb +14 -0
- data/lib/bundler/constants.rb +1 -0
- data/lib/bundler/current_ruby.rb +5 -4
- data/lib/bundler/definition.rb +140 -95
- data/lib/bundler/dep_proxy.rb +2 -0
- data/lib/bundler/dependency.rb +6 -7
- data/lib/bundler/deployment.rb +1 -1
- data/lib/bundler/deprecate.rb +1 -0
- data/lib/bundler/dsl.rb +97 -62
- data/lib/bundler/endpoint_specification.rb +9 -0
- data/lib/bundler/env.rb +63 -27
- data/lib/bundler/environment_preserver.rb +26 -6
- data/lib/bundler/errors.rb +1 -0
- data/lib/bundler/feature_flag.rb +39 -4
- data/lib/bundler/fetcher.rb +15 -8
- data/lib/bundler/fetcher/base.rb +1 -0
- data/lib/bundler/fetcher/compact_index.rb +2 -11
- data/lib/bundler/fetcher/dependency.rb +1 -0
- data/lib/bundler/fetcher/downloader.rb +1 -0
- data/lib/bundler/fetcher/index.rb +1 -0
- data/lib/bundler/friendly_errors.rb +2 -1
- data/lib/bundler/gem_helper.rb +14 -9
- data/lib/bundler/gem_helpers.rb +1 -0
- data/lib/bundler/gem_remote_fetcher.rb +1 -0
- data/lib/bundler/gem_tasks.rb +1 -0
- data/lib/bundler/gem_version_promoter.rb +1 -0
- data/lib/bundler/gemdeps.rb +1 -0
- data/lib/bundler/graph.rb +1 -0
- data/lib/bundler/index.rb +15 -8
- data/lib/bundler/injector.rb +25 -22
- data/lib/bundler/inline.rb +5 -7
- data/lib/bundler/installer.rb +93 -45
- data/lib/bundler/installer/gem_installer.rb +2 -0
- data/lib/bundler/installer/parallel_installer.rb +73 -42
- data/lib/bundler/installer/standalone.rb +1 -0
- data/lib/bundler/lazy_specification.rb +2 -1
- data/lib/bundler/lockfile_generator.rb +95 -0
- data/lib/bundler/lockfile_parser.rb +10 -4
- data/lib/bundler/match_platform.rb +1 -0
- data/lib/bundler/mirror.rb +6 -3
- data/lib/bundler/plugin.rb +1 -0
- data/lib/bundler/plugin/api/source.rb +8 -0
- data/lib/bundler/plugin/installer.rb +7 -6
- data/lib/bundler/plugin/source_list.rb +7 -8
- data/lib/bundler/process_lock.rb +24 -0
- data/lib/bundler/psyched_yaml.rb +1 -0
- data/lib/bundler/remote_specification.rb +1 -0
- data/lib/bundler/resolver.rb +138 -191
- data/lib/bundler/resolver/spec_group.rb +111 -0
- data/lib/bundler/retry.rb +1 -0
- data/lib/bundler/ruby_dsl.rb +1 -0
- data/lib/bundler/ruby_version.rb +1 -0
- data/lib/bundler/rubygems_ext.rb +5 -4
- data/lib/bundler/rubygems_gem_installer.rb +23 -0
- data/lib/bundler/rubygems_integration.rb +56 -27
- data/lib/bundler/runtime.rb +3 -5
- data/lib/bundler/settings.rb +177 -76
- data/lib/bundler/settings/validator.rb +79 -0
- data/lib/bundler/setup.rb +1 -0
- data/lib/bundler/shared_helpers.rb +86 -26
- data/lib/bundler/similarity_detector.rb +1 -0
- data/lib/bundler/source.rb +32 -0
- data/lib/bundler/source/gemspec.rb +1 -0
- data/lib/bundler/source/git.rb +21 -16
- data/lib/bundler/source/git/git_proxy.rb +14 -10
- data/lib/bundler/source/metadata.rb +63 -0
- data/lib/bundler/source/path.rb +8 -8
- data/lib/bundler/source/path/installer.rb +2 -0
- data/lib/bundler/source/rubygems.rb +131 -84
- data/lib/bundler/source/rubygems/remote.rb +3 -0
- data/lib/bundler/source_list.rb +75 -15
- data/lib/bundler/spec_set.rb +2 -1
- data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
- data/lib/bundler/stub_specification.rb +1 -0
- data/lib/bundler/templates/Executable +4 -0
- data/lib/bundler/templates/Executable.bundler +105 -0
- data/lib/bundler/templates/Gemfile +1 -0
- data/lib/bundler/templates/gems.rb +8 -0
- data/lib/bundler/templates/newgem/README.md.tt +1 -1
- data/lib/bundler/templates/newgem/gitignore.tt +0 -1
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
- data/lib/bundler/templates/newgem/rspec.tt +1 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
- data/lib/bundler/ui.rb +1 -0
- data/lib/bundler/ui/rg_proxy.rb +1 -0
- data/lib/bundler/ui/shell.rb +15 -4
- data/lib/bundler/ui/silent.rb +1 -0
- data/lib/bundler/uri_credentials_filter.rb +1 -0
- data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +3 -2
- data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -6
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +487 -148
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
- data/lib/bundler/vendored_fileutils.rb +9 -0
- data/lib/bundler/vendored_molinillo.rb +1 -0
- data/lib/bundler/vendored_persistent.rb +34 -0
- data/lib/bundler/vendored_thor.rb +1 -0
- data/lib/bundler/version.rb +6 -2
- data/lib/bundler/version_ranges.rb +1 -0
- data/lib/bundler/vlad.rb +5 -0
- data/lib/bundler/worker.rb +1 -0
- data/lib/bundler/yaml_serializer.rb +3 -3
- data/man/bundle-add.1 +43 -0
- data/man/bundle-add.1.txt +40 -0
- data/man/bundle-binstubs.1 +40 -0
- data/man/bundle-binstubs.1.txt +48 -0
- data/man/bundle-binstubs.ronn +14 -0
- data/man/bundle-check.1 +31 -0
- data/man/bundle-check.1.txt +32 -0
- data/man/bundle-clean.1 +24 -0
- data/man/bundle-clean.1.txt +26 -0
- data/man/bundle-config.1 +455 -0
- data/man/bundle-config.1.txt +491 -0
- data/man/bundle-config.ronn +133 -79
- data/man/bundle-exec.1 +165 -0
- data/man/bundle-exec.1.txt +178 -0
- data/man/bundle-exec.ronn +7 -0
- data/man/bundle-gem.1 +80 -0
- data/man/bundle-gem.1.txt +91 -0
- data/man/bundle-gem.ronn +2 -1
- data/man/bundle-info.1 +20 -0
- data/man/bundle-info.1.txt +21 -0
- data/man/bundle-init.1 +20 -0
- data/man/bundle-init.1.txt +24 -0
- data/man/bundle-inject.1 +33 -0
- data/man/bundle-inject.1.txt +32 -0
- data/man/bundle-install.1 +305 -0
- data/man/bundle-install.1.txt +385 -0
- data/man/bundle-install.ronn +32 -32
- data/man/bundle-list.1 +20 -0
- data/man/bundle-list.1.txt +21 -0
- data/man/bundle-list.ronn +15 -0
- data/man/bundle-lock.1 +84 -0
- data/man/bundle-lock.1.txt +93 -0
- data/man/bundle-open.1 +32 -0
- data/man/bundle-open.1.txt +29 -0
- data/man/bundle-outdated.1 +151 -0
- data/man/bundle-outdated.1.txt +127 -0
- data/man/bundle-outdated.ronn +1 -1
- data/man/bundle-package.1 +55 -0
- data/man/bundle-package.1.txt +79 -0
- data/man/bundle-package.ronn +5 -0
- data/man/bundle-platform.1 +61 -0
- data/man/bundle-platform.1.txt +57 -0
- data/man/bundle-pristine.1 +34 -0
- data/man/bundle-pristine.1.txt +44 -0
- data/man/bundle-pristine.ronn +24 -3
- data/man/bundle-show.1 +23 -0
- data/man/bundle-show.1.txt +25 -0
- data/man/bundle-update.1 +390 -0
- data/man/bundle-update.1.txt +386 -0
- data/man/bundle-update.ronn +2 -2
- data/man/bundle-viz.1 +39 -0
- data/man/bundle-viz.1.txt +38 -0
- data/man/bundle-viz.ronn +5 -5
- data/man/bundle.1 +132 -0
- data/man/bundle.1.txt +113 -0
- data/man/bundle.ronn +5 -2
- data/man/gemfile.5 +679 -0
- data/man/gemfile.5.ronn +31 -0
- data/man/gemfile.5.txt +636 -0
- data/man/index.txt +23 -0
- metadata +21 -36
- data/.codeclimate.yml +0 -25
- data/.gitignore +0 -18
- data/.rspec +0 -3
- data/.rubocop.yml +0 -131
- data/.rubocop_todo.yml +0 -418
- data/.travis.yml +0 -122
- data/CODE_OF_CONDUCT.md +0 -42
- data/CONTRIBUTING.md +0 -17
- data/Rakefile +0 -338
- data/bin/rake +0 -19
- data/bin/rspec +0 -15
- data/bin/rubocop +0 -17
- data/bin/with_rubygems +0 -39
- data/bundler.gemspec +0 -48
- data/doc/README.md +0 -30
- data/doc/TROUBLESHOOTING.md +0 -64
- data/doc/contributing/BUG_TRIAGE.md +0 -36
- data/doc/contributing/COMMUNITY.md +0 -13
- data/doc/contributing/GETTING_HELP.md +0 -11
- data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
- data/doc/contributing/ISSUES.md +0 -51
- data/doc/contributing/README.md +0 -38
- data/doc/development/NEW_FEATURES.md +0 -10
- data/doc/development/PULL_REQUESTS.md +0 -40
- data/doc/development/README.md +0 -19
- data/doc/development/RELEASING.md +0 -9
- data/doc/development/SETUP.md +0 -27
- data/doc/documentation/README.md +0 -29
- data/doc/documentation/VISION.md +0 -26
- data/doc/documentation/WRITING.md +0 -54
- data/task/release.rake +0 -116
data/man/bundle-config.ronn
CHANGED
@@ -49,27 +49,30 @@ If these options must be remembered,they must be set using `bundle config`
|
|
49
49
|
The options that can be configured are:
|
50
50
|
|
51
51
|
* `bin`:
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
Creates a directory (defaults to `~/bin`) and place any executables from the
|
53
|
+
gem there. These executables run in Bundler's context. If used, you might add
|
54
|
+
this directory to your environment's `PATH` variable. For instance, if the
|
55
|
+
`rails` gem comes with a `rails` executable, this flag will create a
|
56
|
+
`bin/rails` executable that ensures that all referred dependencies will be
|
57
|
+
resolved using the bundled gems.
|
58
58
|
|
59
59
|
* `deployment`:
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
In deployment mode, Bundler will 'roll-out' the bundle for
|
61
|
+
`production` use. Please check carefully if you want to have this option
|
62
|
+
enabled in `development` or `test` environments.
|
63
63
|
|
64
64
|
* `path`:
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
65
|
+
The location to install the specified gems to. This defaults to Rubygems'
|
66
|
+
setting. Bundler shares this location with Rubygems, `gem install ...` will
|
67
|
+
have gem installed there, too. Therefore, gems installed without a
|
68
|
+
`--path ...` setting will show up by calling `gem list`. Accordingly, gems
|
69
|
+
installed to other locations will not get listed.
|
70
70
|
|
71
71
|
* `without`:
|
72
|
-
|
72
|
+
A space-separated list of groups referencing gems to skip during installation.
|
73
|
+
|
74
|
+
* `with`:
|
75
|
+
A space-separated list of groups referencing gems to include during installation.
|
73
76
|
|
74
77
|
## BUILD OPTIONS
|
75
78
|
|
@@ -99,8 +102,8 @@ For instance, passing the `--without` flag to [bundle install(1)][bundle-install
|
|
99
102
|
prevents Bundler from installing certain groups specified in the Gemfile(5). Bundler
|
100
103
|
persists this value in `app/.bundle/config` so that calls to `Bundler.setup`
|
101
104
|
do not try to find gems from the `Gemfile` that you didn't install. Additionally,
|
102
|
-
subsequent calls to [bundle install(1)][bundle-install] remember this setting
|
103
|
-
groups.
|
105
|
+
subsequent calls to [bundle install(1)][bundle-install] remember this setting
|
106
|
+
and skip those groups.
|
104
107
|
|
105
108
|
The canonical form of this configuration is `"without"`. To convert the canonical
|
106
109
|
form to the environment variable form, capitalize it, and prepend `BUNDLE_`. The
|
@@ -115,86 +118,89 @@ the environment variable `BUNDLE_LOCAL__RACK`.
|
|
115
118
|
The following is a list of all configuration keys and their purpose. You can
|
116
119
|
learn more about their operation in [bundle install(1)][bundle-install].
|
117
120
|
|
118
|
-
* `
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
Disallow changes to the `Gemfile`. Defaults to `true` when `--deployment`
|
125
|
-
is used.
|
126
|
-
* `without` (`BUNDLE_WITHOUT`):
|
127
|
-
A `:`-separated list of groups whose gems bundler should not install
|
128
|
-
* `bin` (`BUNDLE_BIN`):
|
129
|
-
Install executables from gems in the bundle to the specified directory.
|
130
|
-
Defaults to `false`.
|
131
|
-
* `gemfile` (`BUNDLE_GEMFILE`):
|
132
|
-
The name of the file that bundler should use as the `Gemfile`. This location
|
133
|
-
of this file also sets the root of the project, which is used to resolve
|
134
|
-
relative paths in the `Gemfile`, among other things. By default, bundler
|
135
|
-
will search up from the current working directory until it finds a
|
136
|
-
`Gemfile`.
|
137
|
-
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
138
|
-
Path to a designated CA certificate file or folder containing multiple
|
139
|
-
certificates for trusted CAs in PEM format.
|
140
|
-
* `ssl_client_cert` (`BUNDLE_SSL_CLIENT_CERT`):
|
141
|
-
Path to a designated file containing a X.509 client certificate
|
142
|
-
and key in PEM format.
|
143
|
-
* `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place
|
144
|
-
cached gems in when running <code>bundle package</code>, and that bundler
|
145
|
-
will look in when installing gems. Defaults to `vendor/bundle`.
|
146
|
-
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles
|
147
|
-
containing multiple sources will produce errors instead of warnings. Use
|
148
|
-
`bundle config --delete disable_multisource` to unset.
|
149
|
-
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
|
150
|
-
messages will be printed. To silence a single gem, use dot notation like
|
151
|
-
`ignore_messages.httparty true`.
|
152
|
-
* `retry` (`BUNDLE_RETRY`):
|
153
|
-
The number of times to retry failed network requests. Defaults to `3`.
|
154
|
-
* `redirect` (`BUNDLE_REDIRECT`):
|
155
|
-
The number of redirects allowed for network requests. Defaults to `5`.
|
156
|
-
* `timeout` (`BUNDLE_TIMEOUT`):
|
157
|
-
The seconds allowed before timing out for network requests. Defaults to `10`.
|
158
|
-
* `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
|
159
|
-
Ignore the current machine's platform and install only `ruby` platform gems.
|
160
|
-
As a result, gems with native extensions will be compiled from source.
|
161
|
-
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
162
|
-
Allow bundler to resolve for the specific running platform and store it in
|
163
|
-
the lockfile, instead of only using a generic platform.
|
164
|
-
A specific platform is the exact platform triple reported by
|
165
|
-
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
166
|
-
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
167
|
-
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
168
|
-
`universal-java-1.8` to `java`.
|
169
|
-
* `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`):
|
170
|
-
Allow installing gems even if they do not match the checksum provided by
|
171
|
-
RubyGems.
|
172
|
-
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
|
173
|
-
Stop Bundler from checking if a newer Bundler version is available on
|
174
|
-
rubygems.org.
|
121
|
+
* `allow_bundler_dependency_conflicts` (`BUNDLE_ALLOW_BUNDLER_DEPENDENCY_CONFLICTS`):
|
122
|
+
Allow resolving to specifications that have dependencies on `bundler` that
|
123
|
+
are incompatible with the running Bundler version.
|
124
|
+
* `allow_deployment_source_credential_changes` (`BUNDLE_ALLOW_DEPLOYMENT_SOURCE_CREDENTIAL_CHANGES`):
|
125
|
+
When in deployment mode, allow changing the credentials to a gem's source.
|
126
|
+
Ex: `https://some.host.com/gems/path/` -> `https://user_name:password@some.host.com/gems/path`
|
175
127
|
* `allow_offline_install` (`BUNDLE_ALLOW_OFFLINE_INSTALL`):
|
176
128
|
Allow Bundler to use cached data when installing without network access.
|
129
|
+
* `auto_clean_without_path` (`BUNDLE_AUTO_CLEAN_WITHOUT_PATH`):
|
130
|
+
Automatically run `bundle clean` after installing when an explicit `path`
|
131
|
+
has not been set and Bundler is not installing into the system gems.
|
177
132
|
* `auto_install` (`BUNDLE_AUTO_INSTALL`):
|
178
133
|
Automatically run `bundle install` when gems are missing.
|
179
|
-
* `
|
180
|
-
|
134
|
+
* `bin` (`BUNDLE_BIN`):
|
135
|
+
Install executables from gems in the bundle to the specified directory.
|
136
|
+
Defaults to `false`.
|
181
137
|
* `cache_all` (`BUNDLE_CACHE_ALL`):
|
182
138
|
Cache all gems, including path and git gems.
|
139
|
+
* `cache_all_platforms` (`BUNDLE_CACHE_ALL_PLATFORMS`):
|
140
|
+
Cache gems for all platforms.
|
141
|
+
* `cache_path` (`BUNDLE_CACHE_PATH`):
|
142
|
+
The directory that bundler will place cached gems in when running
|
143
|
+
<code>bundle package</code>, and that bundler will look in when installing gems.
|
144
|
+
Defaults to `vendor/bundle`.
|
183
145
|
* `clean` (`BUNDLE_CLEAN`):
|
184
146
|
Whether Bundler should run `bundle clean` automatically after
|
185
147
|
`bundle install`.
|
186
148
|
* `console` (`BUNDLE_CONSOLE`):
|
187
149
|
The console that `bundle console` starts. Defaults to `irb`.
|
150
|
+
* `default_install_uses_path` (`BUNDLE_DEFAULT_INSTALL_USES_PATH`):
|
151
|
+
Whether a `bundle install` without an explicit `--path` argument defaults
|
152
|
+
to installing gems in `.bundle`.
|
153
|
+
* `deployment` (`BUNDLE_DEPLOYMENT`):
|
154
|
+
Disallow changes to the `Gemfile`. When the `Gemfile` is changed and the
|
155
|
+
lockfile has not been updated, running Bundler commands will be blocked.
|
156
|
+
* `disable_checksum_validation` (`BUNDLE_DISABLE_CHECKSUM_VALIDATION`):
|
157
|
+
Allow installing gems even if they do not match the checksum provided by
|
158
|
+
RubyGems.
|
188
159
|
* `disable_exec_load` (`BUNDLE_DISABLE_EXEC_LOAD`):
|
189
160
|
Stop Bundler from using `load` to launch an executable in-process in
|
190
161
|
`bundle exec`.
|
191
162
|
* `disable_local_branch_check` (`BUNDLE_DISABLE_LOCAL_BRANCH_CHECK`):
|
192
163
|
Allow Bundler to use a local git override without a branch specified in the
|
193
164
|
Gemfile.
|
165
|
+
* `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`):
|
166
|
+
When set, Gemfiles containing multiple sources will produce errors
|
167
|
+
instead of warnings.
|
168
|
+
Use `bundle config --delete disable_multisource` to unset.
|
194
169
|
* `disable_shared_gems` (`BUNDLE_DISABLE_SHARED_GEMS`):
|
195
170
|
Stop Bundler from accessing gems installed to RubyGems' normal location.
|
171
|
+
* `disable_version_check` (`BUNDLE_DISABLE_VERSION_CHECK`):
|
172
|
+
Stop Bundler from checking if a newer Bundler version is available on
|
173
|
+
rubygems.org.
|
174
|
+
* `error_on_stderr` (`BUNDLE_ERROR_ON_STDERR`):
|
175
|
+
Print Bundler errors to stderr.
|
176
|
+
* `force_ruby_platform` (`BUNDLE_FORCE_RUBY_PLATFORM`):
|
177
|
+
Ignore the current machine's platform and install only `ruby` platform gems.
|
178
|
+
As a result, gems with native extensions will be compiled from source.
|
179
|
+
* `frozen` (`BUNDLE_FROZEN`):
|
180
|
+
Disallow changes to the `Gemfile`. When the `Gemfile` is changed and the
|
181
|
+
lockfile has not been updated, running Bundler commands will be blocked.
|
182
|
+
Defaults to `true` when `--deployment` is used.
|
183
|
+
* `gem.push_key` (`BUNDLE_GEM__PUSH_KEY`):
|
184
|
+
Sets the `--key` parameter for `gem push` when using the `rake release`
|
185
|
+
command with a private gemstash server.
|
186
|
+
* `gemfile` (`BUNDLE_GEMFILE`):
|
187
|
+
The name of the file that bundler should use as the `Gemfile`. This location
|
188
|
+
of this file also sets the root of the project, which is used to resolve
|
189
|
+
relative paths in the `Gemfile`, among other things. By default, bundler
|
190
|
+
will search up from the current working directory until it finds a
|
191
|
+
`Gemfile`.
|
192
|
+
* `global_gem_cache` (`BUNDLE_GLOBAL_GEM_CACHE`):
|
193
|
+
Whether Bundler should cache all gems globally, rather than locally to the
|
194
|
+
installing Ruby installation.
|
195
|
+
* `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
|
196
|
+
messages will be printed. To silence a single gem, use dot notation like
|
197
|
+
`ignore_messages.httparty true`.
|
198
|
+
* `init_gems_rb` (`BUNDLE_INIT_GEMS_RB`)
|
199
|
+
Generate a `gems.rb` instead of a `Gemfile` when running `bundle init`.
|
196
200
|
* `jobs` (`BUNDLE_JOBS`):
|
197
201
|
The number of gems Bundler can install in parallel. Defaults to 1.
|
202
|
+
* `list_command` (`BUNDLE_LIST_COMMAND`)
|
203
|
+
Enable new list command feature
|
198
204
|
* `major_deprecations` (`BUNDLE_MAJOR_DEPRECATIONS`):
|
199
205
|
Whether Bundler should print deprecation warnings for behavior that will
|
200
206
|
be changed in the next major version.
|
@@ -205,23 +211,70 @@ learn more about their operation in [bundle install(1)][bundle-install].
|
|
205
211
|
* `only_update_to_newer_versions` (`BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS`):
|
206
212
|
During `bundle update`, only resolve to newer versions of the gems in the
|
207
213
|
lockfile.
|
214
|
+
* `path` (`BUNDLE_PATH`):
|
215
|
+
The location on disk where all gems in your bundle will be located regardless
|
216
|
+
of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
|
217
|
+
will be installed by `bundle install`. Defaults to `Gem.dir`. When --deployment
|
218
|
+
is used, defaults to vendor/bundle.
|
219
|
+
* `path.system` (`BUNDLE_PATH__SYSTEM`):
|
220
|
+
Whether Bundler will install gems into the default system path (`Gem.dir`).
|
208
221
|
* `plugins` (`BUNDLE_PLUGINS`):
|
209
222
|
Enable Bundler's experimental plugin system.
|
223
|
+
* `prefer_gems_rb` (`BUNDLE_PREFER_GEMS_RB`)
|
224
|
+
Prefer `gems.rb` to `Gemfile` when Bundler is searching for a Gemfile.
|
225
|
+
* `print_only_version_number` (`BUNDLE_PRINT_ONLY_VERSION_NUMBER`)
|
226
|
+
Print only version number from `bundler --version`.
|
227
|
+
* `redirect` (`BUNDLE_REDIRECT`):
|
228
|
+
The number of redirects allowed for network requests. Defaults to `5`.
|
229
|
+
* `retry` (`BUNDLE_RETRY`):
|
230
|
+
The number of times to retry failed network requests. Defaults to `3`.
|
231
|
+
* `setup_makes_kernel_gem_public` (`BUNDLE_SETUP_MAKES_KERNEL_GEM_PUBLIC`):
|
232
|
+
Have `Bundler.setup` make the `Kernel#gem` method public, even though
|
233
|
+
RubyGems declares it as private.
|
210
234
|
* `shebang` (`BUNDLE_SHEBANG`):
|
211
235
|
The program name that should be invoked for generated binstubs. Defaults to
|
212
236
|
the ruby install name used to generate the binstub.
|
213
237
|
* `silence_root_warning` (`BUNDLE_SILENCE_ROOT_WARNING`):
|
214
238
|
Silence the warning Bundler prints when installing gems as root.
|
239
|
+
* `skip_default_git_sources` (`BUNDLE_SKIP_DEFAULT_GIT_SOURCES`):
|
240
|
+
Whether Bundler should skip adding default git source shortcuts to the
|
241
|
+
Gemfile DSL.
|
242
|
+
* `specific_platform` (`BUNDLE_SPECIFIC_PLATFORM`):
|
243
|
+
Allow bundler to resolve for the specific running platform and store it in
|
244
|
+
the lockfile, instead of only using a generic platform.
|
245
|
+
A specific platform is the exact platform triple reported by
|
246
|
+
`Gem::Platform.local`, such as `x86_64-darwin-16` or `universal-java-1.8`.
|
247
|
+
On the other hand, generic platforms are those such as `ruby`, `mswin`, or
|
248
|
+
`java`. In this example, `x86_64-darwin-16` would map to `ruby` and
|
249
|
+
`universal-java-1.8` to `java`.
|
250
|
+
* `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
|
251
|
+
Path to a designated CA certificate file or folder containing multiple
|
252
|
+
certificates for trusted CAs in PEM format.
|
253
|
+
* `ssl_client_cert` (`BUNDLE_SSL_CLIENT_CERT`):
|
254
|
+
Path to a designated file containing a X.509 client certificate
|
255
|
+
and key in PEM format.
|
215
256
|
* `ssl_verify_mode` (`BUNDLE_SSL_VERIFY_MODE`):
|
216
257
|
The SSL verification mode Bundler uses when making HTTPS requests.
|
217
258
|
Defaults to verify peer.
|
259
|
+
* `suppress_install_using_messages` (`BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES`):
|
260
|
+
Avoid printing `Using ...` messages during installation when the version of
|
261
|
+
a gem has not changed.
|
218
262
|
* `system_bindir` (`BUNDLE_SYSTEM_BINDIR`):
|
219
263
|
The location where RubyGems installs binstubs. Defaults to `Gem.bindir`.
|
264
|
+
* `timeout` (`BUNDLE_TIMEOUT`):
|
265
|
+
The seconds allowed before timing out for network requests. Defaults to `10`.
|
266
|
+
* `unlock_source_unlocks_spec` (`BUNDLE_UNLOCK_SOURCE_UNLOCKS_SPEC`):
|
267
|
+
Whether running `bundle update --source NAME` unlocks a gem with the given
|
268
|
+
name. Defaults to `true`.
|
269
|
+
* `update_requires_all_flag` (`BUNDLE_UPDATE_REQUIRES_ALL_FLAG`)
|
270
|
+
Require passing `--all` to `bundle update` when everything should be updated,
|
271
|
+
and disallow passing no options to `bundle update`.
|
220
272
|
* `user_agent` (`BUNDLE_USER_AGENT`):
|
221
273
|
The custom user agent fragment Bundler includes in API requests.
|
222
|
-
* `
|
223
|
-
|
224
|
-
|
274
|
+
* `with` (`BUNDLE_WITH`):
|
275
|
+
A `:`-separated list of groups whose gems bundler should install.
|
276
|
+
* `without` (`BUNDLE_WITHOUT`):
|
277
|
+
A `:`-separated list of groups whose gems bundler should not install.
|
225
278
|
|
226
279
|
In general, you should set these settings per-application by using the applicable
|
227
280
|
flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command.
|
@@ -250,6 +303,7 @@ revision in the `Gemfile.lock` to the local git repo revision. This
|
|
250
303
|
requires the same attention as git submodules. Before pushing to
|
251
304
|
the remote, you need to ensure the local override was pushed, otherwise
|
252
305
|
you may point to a commit that only exists in your local machine.
|
306
|
+
You'll also need to CGI escape your usernames and passwords as well.
|
253
307
|
|
254
308
|
Bundler does many checks to ensure a developer won't work with
|
255
309
|
invalid references. Particularly, we force a developer to specify
|
data/man/bundle-exec.1
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "BUNDLE\-EXEC" "1" "August 2017" "" ""
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBbundle\-exec\fR \- Execute a command in the context of the bundle
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBbundle exec\fR [\-\-keep\-file\-descriptors] \fIcommand\fR
|
11
|
+
.
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
This command executes the command, making all gems specified in the \fBGemfile(5)\fR available to \fBrequire\fR in Ruby programs\.
|
14
|
+
.
|
15
|
+
.P
|
16
|
+
Essentially, if you would normally have run something like \fBrspec spec/my_spec\.rb\fR, and you want to use the gems specified in the \fBGemfile(5)\fR and installed via [bundle install(1)][bundle\-install], you should run \fBbundle exec rspec spec/my_spec\.rb\fR\.
|
17
|
+
.
|
18
|
+
.P
|
19
|
+
Note that \fBbundle exec\fR does not require that an executable is available on your shell\'s \fB$PATH\fR\.
|
20
|
+
.
|
21
|
+
.SH "OPTIONS"
|
22
|
+
.
|
23
|
+
.TP
|
24
|
+
\fB\-\-keep\-file\-descriptors\fR
|
25
|
+
Exec in Ruby 2\.0 began discarding non\-standard file descriptors\. When this flag is passed, exec will revert to the 1\.9 behaviour of passing all file descriptors to the new process\.
|
26
|
+
.
|
27
|
+
.SH "BUNDLE INSTALL \-\-BINSTUBS"
|
28
|
+
If you use the \fB\-\-binstubs\fR flag in [bundle install(1)][bundle\-install], Bundler will automatically create a directory (which defaults to \fBapp_root/bin\fR) containing all of the executables available from gems in the bundle\.
|
29
|
+
.
|
30
|
+
.P
|
31
|
+
After using \fB\-\-binstubs\fR, \fBbin/rspec spec/my_spec\.rb\fR is identical to \fBbundle exec rspec spec/my_spec\.rb\fR\.
|
32
|
+
.
|
33
|
+
.SH "ENVIRONMENT MODIFICATIONS"
|
34
|
+
\fBbundle exec\fR makes a number of changes to the shell environment, then executes the command you specify in full\.
|
35
|
+
.
|
36
|
+
.IP "\(bu" 4
|
37
|
+
make sure that it\'s still possible to shell out to \fBbundle\fR from inside a command invoked by \fBbundle exec\fR (using \fB$BUNDLE_BIN_PATH\fR)
|
38
|
+
.
|
39
|
+
.IP "\(bu" 4
|
40
|
+
put the directory containing executables (like \fBrails\fR, \fBrspec\fR, \fBrackup\fR) for your bundle on \fB$PATH\fR
|
41
|
+
.
|
42
|
+
.IP "\(bu" 4
|
43
|
+
make sure that if bundler is invoked in the subshell, it uses the same \fBGemfile\fR (by setting \fBBUNDLE_GEMFILE\fR)
|
44
|
+
.
|
45
|
+
.IP "\(bu" 4
|
46
|
+
add \fB\-rbundler/setup\fR to \fB$RUBYOPT\fR, which makes sure that Ruby programs invoked in the subshell can see the gems in the bundle
|
47
|
+
.
|
48
|
+
.IP "" 0
|
49
|
+
.
|
50
|
+
.P
|
51
|
+
It also modifies Rubygems:
|
52
|
+
.
|
53
|
+
.IP "\(bu" 4
|
54
|
+
disallow loading additional gems not in the bundle
|
55
|
+
.
|
56
|
+
.IP "\(bu" 4
|
57
|
+
modify the \fBgem\fR method to be a no\-op if a gem matching the requirements is in the bundle, and to raise a \fBGem::LoadError\fR if it\'s not
|
58
|
+
.
|
59
|
+
.IP "\(bu" 4
|
60
|
+
Define \fBGem\.refresh\fR to be a no\-op, since the source index is always frozen when using bundler, and to prevent gems from the system leaking into the environment
|
61
|
+
.
|
62
|
+
.IP "\(bu" 4
|
63
|
+
Override \fBGem\.bin_path\fR to use the gems in the bundle, making system executables work
|
64
|
+
.
|
65
|
+
.IP "\(bu" 4
|
66
|
+
Add all gems in the bundle into Gem\.loaded_specs
|
67
|
+
.
|
68
|
+
.IP "" 0
|
69
|
+
.
|
70
|
+
.P
|
71
|
+
Finally, \fBbundle exec\fR also implicitly modifies \fBGemfile\.lock\fR if the lockfile and the Gemfile do not match\. Bundler needs the Gemfile to determine things such as a gem\'s groups, \fBautorequire\fR, and platforms, etc\., and that information isn\'t stored in the lockfile\. The Gemfile and lockfile must be synced in order to \fBbundle exec\fR successfully, so \fBbundle exec\fR updates the lockfile beforehand\.
|
72
|
+
.
|
73
|
+
.SS "Loading"
|
74
|
+
By default, when attempting to \fBbundle exec\fR to a file with a ruby shebang, Bundler will \fBKernel\.load\fR that file instead of using \fBKernel\.exec\fR\. For the vast majority of cases, this is a performance improvement\. In a rare few cases, this could cause some subtle side\-effects (such as dependence on the exact contents of \fB$0\fR or \fB__FILE__\fR) and the optimization can be disabled by enabling the \fBdisable_exec_load\fR setting\.
|
75
|
+
.
|
76
|
+
.SS "Shelling out"
|
77
|
+
Any Ruby code that opens a subshell (like \fBsystem\fR, backticks, or \fB%x{}\fR) will automatically use the current Bundler environment\. If you need to shell out to a Ruby command that is not part of your current bundle, use the \fBwith_clean_env\fR method with a block\. Any subshells created inside the block will be given the environment present before Bundler was activated\. For example, Homebrew commands run Ruby, but don\'t work inside a bundle:
|
78
|
+
.
|
79
|
+
.IP "" 4
|
80
|
+
.
|
81
|
+
.nf
|
82
|
+
|
83
|
+
Bundler\.with_clean_env do
|
84
|
+
`brew install wget`
|
85
|
+
end
|
86
|
+
.
|
87
|
+
.fi
|
88
|
+
.
|
89
|
+
.IP "" 0
|
90
|
+
.
|
91
|
+
.P
|
92
|
+
Using \fBwith_clean_env\fR is also necessary if you are shelling out to a different bundle\. Any Bundler commands run in a subshell will inherit the current Gemfile, so commands that need to run in the context of a different bundle also need to use \fBwith_clean_env\fR\.
|
93
|
+
.
|
94
|
+
.IP "" 4
|
95
|
+
.
|
96
|
+
.nf
|
97
|
+
|
98
|
+
Bundler\.with_clean_env do
|
99
|
+
Dir\.chdir "/other/bundler/project" do
|
100
|
+
`bundle exec \./script`
|
101
|
+
end
|
102
|
+
end
|
103
|
+
.
|
104
|
+
.fi
|
105
|
+
.
|
106
|
+
.IP "" 0
|
107
|
+
.
|
108
|
+
.P
|
109
|
+
Bundler provides convenience helpers that wrap \fBsystem\fR and \fBexec\fR, and they can be used like this:
|
110
|
+
.
|
111
|
+
.IP "" 4
|
112
|
+
.
|
113
|
+
.nf
|
114
|
+
|
115
|
+
Bundler\.clean_system(\'brew install wget\')
|
116
|
+
Bundler\.clean_exec(\'brew install wget\')
|
117
|
+
.
|
118
|
+
.fi
|
119
|
+
.
|
120
|
+
.IP "" 0
|
121
|
+
.
|
122
|
+
.SH "RUBYGEMS PLUGINS"
|
123
|
+
At present, the Rubygems plugin system requires all files named \fBrubygems_plugin\.rb\fR on the load path of \fIany\fR installed gem when any Ruby code requires \fBrubygems\.rb\fR\. This includes executables installed into the system, like \fBrails\fR, \fBrackup\fR, and \fBrspec\fR\.
|
124
|
+
.
|
125
|
+
.P
|
126
|
+
Since Rubygems plugins can contain arbitrary Ruby code, they commonly end up activating themselves or their dependencies\.
|
127
|
+
.
|
128
|
+
.P
|
129
|
+
For instance, the \fBgemcutter 0\.5\fR gem depended on \fBjson_pure\fR\. If you had that version of gemcutter installed (even if you \fIalso\fR had a newer version without this problem), Rubygems would activate \fBgemcutter 0\.5\fR and \fBjson_pure <latest>\fR\.
|
130
|
+
.
|
131
|
+
.P
|
132
|
+
If your Gemfile(5) also contained \fBjson_pure\fR (or a gem with a dependency on \fBjson_pure\fR), the latest version on your system might conflict with the version in your Gemfile(5), or the snapshot version in your \fBGemfile\.lock\fR\.
|
133
|
+
.
|
134
|
+
.P
|
135
|
+
If this happens, bundler will say:
|
136
|
+
.
|
137
|
+
.IP "" 4
|
138
|
+
.
|
139
|
+
.nf
|
140
|
+
|
141
|
+
You have already activated json_pure 1\.4\.6 but your Gemfile
|
142
|
+
requires json_pure 1\.4\.3\. Consider using bundle exec\.
|
143
|
+
.
|
144
|
+
.fi
|
145
|
+
.
|
146
|
+
.IP "" 0
|
147
|
+
.
|
148
|
+
.P
|
149
|
+
In this situation, you almost certainly want to remove the underlying gem with the problematic gem plugin\. In general, the authors of these plugins (in this case, the \fBgemcutter\fR gem) have released newer versions that are more careful in their plugins\.
|
150
|
+
.
|
151
|
+
.P
|
152
|
+
You can find a list of all the gems containing gem plugins by running
|
153
|
+
.
|
154
|
+
.IP "" 4
|
155
|
+
.
|
156
|
+
.nf
|
157
|
+
|
158
|
+
ruby \-rubygems \-e "puts Gem\.find_files(\'rubygems_plugin\.rb\')"
|
159
|
+
.
|
160
|
+
.fi
|
161
|
+
.
|
162
|
+
.IP "" 0
|
163
|
+
.
|
164
|
+
.P
|
165
|
+
At the very least, you should remove all but the newest version of each gem plugin, and also remove all gem plugins that you aren\'t using (\fBgem uninstall gem_name\fR)\.
|
@@ -0,0 +1,178 @@
|
|
1
|
+
BUNDLE-EXEC(1) BUNDLE-EXEC(1)
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
1mNAME0m
|
6
|
+
1mbundle-exec 22m- Execute a command in the context of the bundle
|
7
|
+
|
8
|
+
1mSYNOPSIS0m
|
9
|
+
1mbundle exec 22m[--keep-file-descriptors] 4mcommand0m
|
10
|
+
|
11
|
+
1mDESCRIPTION0m
|
12
|
+
This command executes the command, making all gems specified in the
|
13
|
+
1mGemfile(5) 22mavailable to 1mrequire 22min Ruby programs.
|
14
|
+
|
15
|
+
Essentially, if you would normally have run something like 1mrspec0m
|
16
|
+
1mspec/my_spec.rb22m, and you want to use the gems specified in the 1mGem-0m
|
17
|
+
1mfile(5) 22mand installed via [bundle install(1)][bundle-install], you
|
18
|
+
should run 1mbundle exec rspec spec/my_spec.rb22m.
|
19
|
+
|
20
|
+
Note that 1mbundle exec 22mdoes not require that an executable is available
|
21
|
+
on your shell's 1m$PATH22m.
|
22
|
+
|
23
|
+
1mOPTIONS0m
|
24
|
+
1m--keep-file-descriptors0m
|
25
|
+
Exec in Ruby 2.0 began discarding non-standard file descriptors.
|
26
|
+
When this flag is passed, exec will revert to the 1.9 behaviour
|
27
|
+
of passing all file descriptors to the new process.
|
28
|
+
|
29
|
+
1mBUNDLE INSTALL --BINSTUBS0m
|
30
|
+
If you use the 1m--binstubs 22mflag in [bundle install(1)][bundle-install],
|
31
|
+
Bundler will automatically create a directory (which defaults to
|
32
|
+
1mapp_root/bin22m) containing all of the executables available from gems in
|
33
|
+
the bundle.
|
34
|
+
|
35
|
+
After using 1m--binstubs22m, 1mbin/rspec spec/my_spec.rb 22mis identical to 1mbun-0m
|
36
|
+
1mdle exec rspec spec/my_spec.rb22m.
|
37
|
+
|
38
|
+
1mENVIRONMENT MODIFICATIONS0m
|
39
|
+
1mbundle exec 22mmakes a number of changes to the shell environment, then
|
40
|
+
executes the command you specify in full.
|
41
|
+
|
42
|
+
o make sure that it's still possible to shell out to 1mbundle 22mfrom
|
43
|
+
inside a command invoked by 1mbundle exec 22m(using 1m$BUNDLE_BIN_PATH22m)
|
44
|
+
|
45
|
+
o put the directory containing executables (like 1mrails22m, 1mrspec22m,
|
46
|
+
1mrackup22m) for your bundle on 1m$PATH0m
|
47
|
+
|
48
|
+
o make sure that if bundler is invoked in the subshell, it uses the
|
49
|
+
same 1mGemfile 22m(by setting 1mBUNDLE_GEMFILE22m)
|
50
|
+
|
51
|
+
o add 1m-rbundler/setup 22mto 1m$RUBYOPT22m, which makes sure that Ruby pro-
|
52
|
+
grams invoked in the subshell can see the gems in the bundle
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
It also modifies Rubygems:
|
57
|
+
|
58
|
+
o disallow loading additional gems not in the bundle
|
59
|
+
|
60
|
+
o modify the 1mgem 22mmethod to be a no-op if a gem matching the require-
|
61
|
+
ments is in the bundle, and to raise a 1mGem::LoadError 22mif it's not
|
62
|
+
|
63
|
+
o Define 1mGem.refresh 22mto be a no-op, since the source index is always
|
64
|
+
frozen when using bundler, and to prevent gems from the system
|
65
|
+
leaking into the environment
|
66
|
+
|
67
|
+
o Override 1mGem.bin_path 22mto use the gems in the bundle, making system
|
68
|
+
executables work
|
69
|
+
|
70
|
+
o Add all gems in the bundle into Gem.loaded_specs
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
Finally, 1mbundle exec 22malso implicitly modifies 1mGemfile.lock 22mif the lock-
|
75
|
+
file and the Gemfile do not match. Bundler needs the Gemfile to deter-
|
76
|
+
mine things such as a gem's groups, 1mautorequire22m, and platforms, etc.,
|
77
|
+
and that information isn't stored in the lockfile. The Gemfile and
|
78
|
+
lockfile must be synced in order to 1mbundle exec 22msuccessfully, so 1mbundle0m
|
79
|
+
1mexec 22mupdates the lockfile beforehand.
|
80
|
+
|
81
|
+
1mLoading0m
|
82
|
+
By default, when attempting to 1mbundle exec 22mto a file with a ruby she-
|
83
|
+
bang, Bundler will 1mKernel.load 22mthat file instead of using 1mKernel.exec22m.
|
84
|
+
For the vast majority of cases, this is a performance improvement. In a
|
85
|
+
rare few cases, this could cause some subtle side-effects (such as
|
86
|
+
dependence on the exact contents of 1m$0 22mor 1m__FILE__22m) and the optimiza-
|
87
|
+
tion can be disabled by enabling the 1mdisable_exec_load 22msetting.
|
88
|
+
|
89
|
+
1mShelling out0m
|
90
|
+
Any Ruby code that opens a subshell (like 1msystem22m, backticks, or 1m%x{}22m)
|
91
|
+
will automatically use the current Bundler environment. If you need to
|
92
|
+
shell out to a Ruby command that is not part of your current bundle,
|
93
|
+
use the 1mwith_clean_env 22mmethod with a block. Any subshells created
|
94
|
+
inside the block will be given the environment present before Bundler
|
95
|
+
was activated. For example, Homebrew commands run Ruby, but don't work
|
96
|
+
inside a bundle:
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
Bundler.with_clean_env do
|
101
|
+
`brew install wget`
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
Using 1mwith_clean_env 22mis also necessary if you are shelling out to a
|
107
|
+
different bundle. Any Bundler commands run in a subshell will inherit
|
108
|
+
the current Gemfile, so commands that need to run in the context of a
|
109
|
+
different bundle also need to use 1mwith_clean_env22m.
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
Bundler.with_clean_env do
|
114
|
+
Dir.chdir "/other/bundler/project" do
|
115
|
+
`bundle exec ./script`
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
Bundler provides convenience helpers that wrap 1msystem 22mand 1mexec22m, and
|
122
|
+
they can be used like this:
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
Bundler.clean_system('brew install wget')
|
127
|
+
Bundler.clean_exec('brew install wget')
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
1mRUBYGEMS PLUGINS0m
|
132
|
+
At present, the Rubygems plugin system requires all files named
|
133
|
+
1mrubygems_plugin.rb 22mon the load path of 4many24m installed gem when any Ruby
|
134
|
+
code requires 1mrubygems.rb22m. This includes executables installed into the
|
135
|
+
system, like 1mrails22m, 1mrackup22m, and 1mrspec22m.
|
136
|
+
|
137
|
+
Since Rubygems plugins can contain arbitrary Ruby code, they commonly
|
138
|
+
end up activating themselves or their dependencies.
|
139
|
+
|
140
|
+
For instance, the 1mgemcutter 0.5 22mgem depended on 1mjson_pure22m. If you had
|
141
|
+
that version of gemcutter installed (even if you 4malso24m had a newer ver-
|
142
|
+
sion without this problem), Rubygems would activate 1mgemcutter 0.5 22mand
|
143
|
+
1mjson_pure <latest>22m.
|
144
|
+
|
145
|
+
If your Gemfile(5) also contained 1mjson_pure 22m(or a gem with a dependency
|
146
|
+
on 1mjson_pure22m), the latest version on your system might conflict with
|
147
|
+
the version in your Gemfile(5), or the snapshot version in your 1mGem-0m
|
148
|
+
1mfile.lock22m.
|
149
|
+
|
150
|
+
If this happens, bundler will say:
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
You have already activated json_pure 1.4.6 but your Gemfile
|
155
|
+
requires json_pure 1.4.3. Consider using bundle exec.
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
In this situation, you almost certainly want to remove the underlying
|
160
|
+
gem with the problematic gem plugin. In general, the authors of these
|
161
|
+
plugins (in this case, the 1mgemcutter 22mgem) have released newer versions
|
162
|
+
that are more careful in their plugins.
|
163
|
+
|
164
|
+
You can find a list of all the gems containing gem plugins by running
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
ruby -rubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
At the very least, you should remove all but the newest version of each
|
173
|
+
gem plugin, and also remove all gem plugins that you aren't using (1mgem0m
|
174
|
+
1muninstall gem_name22m).
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
August 2017 BUNDLE-EXEC(1)
|