Repository navigation
Explain activation conflicts caused by a Gemfile require - #10109
Merged
Merged
Conversation
A Gemfile can activate a gem through a transitive dependency before Bundler sets up the locked version. The resulting error suggests using `bundle exec` even when the command already uses it.
Using a fixture default gem directory hides the default Bundler spec. With system RubyGems, requiring bundler/setup can then load the copy shipped with Ruby before the example reaches the activation conflict.
This was referenced Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a
requirein the Gemfile activates a conflicting gem, Bundler suggests prependingbundle execeven if the command already uses it. For a default gem, Bundler suggests removing the dependency or updating Bundler.Point to the Gemfile when its evaluation activated the conflicting version, including through a dependency. If a
requirein the Gemfile loads the gem, suggest removing it or moving it into application code afterBundler.setup.Fixes #7178.