bundle install uses one of the flags Bundler 2.x deprecated in favor of BUNDLE_* env vars and
bundle config set.
Description
Bundler 2.x deprecated threebundle install flags in favor of BUNDLE_* env vars and the
bundle config set command:
The flags still work but emit a deprecation notice on every CI run, and are slated for removal in Bundler 3.
The corpus shows only a handful of files using these (3 with
--without, 1 with --deployment), but they
keep showing up in copy-pasted Dockerfile snippets from blog posts written before Bundler 2’s release.
This rule fires on each deprecated flag in a bundle install invocation. Multiple flags in the same
command produce separate violations.
Stages explicitly named dev/development/test/testing/ci/debug are skipped.
Examples
Before
After
bundle install invocations in the same stage.
Auto-fix
--without <groups>→FixSafe. The env-var form is a strict equivalent.--deployment→FixSafe. Same —BUNDLE_DEPLOYMENT="1"is the env-var form of--deployment.--path <dir>→FixSuggestion. The user may have downstreamBUNDLE_PATHexpectations (other RUNs reading from the path) that the env-var version may interact with differently.
RUN chains. The user applies the rewrite manually.
References
- Bundler 2 upgrade guide — full list of deprecated flags and their replacements.
- Bundler
bundle configdocumentation — supported configuration mechanism for Bundler 2.x.