Use original Bundler binstub from RubyGems to avoid version argument issues #2987
+87
−77
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.
Motivation
Closes #2862 and #2731 (comment)
Clearly, adding the Bundler version to the command causes trouble for people using binstubs in certain configurations.
I think I found a way to continue specifying the version, which guarantees that RubyGems will eagerly activate the right specification, while at the same time avoiding those issues.
Implementation
The idea is to invoke the original Bundler binstub generated by RubyGems directly. That way, even if there's a custom binstub, we avoid invoking it and use the default one (which accepts the version).
Automated Tests
Managed to write a test that fails before this fix.
Manual tests
bin/bundle
export PATH ./bin:$PATH
exe/ruby-lsp