Fix plugin new version not registering#9355
Merged
hsbt merged 1 commit intoruby:masterfrom Mar 4, 2026
Merged
Conversation
- ### Problem When a plugin in the Gemfile is updated to a new version, it will be downloaded but will not be registered. The old version of the plugin will be loaded when Bundler is invoked. ### Context The problem is in the `Index#installed?` method that only checks for the plugin name in the index. If it finds one, it skips the registration. ### Solution Check whether the registed plugin load paths matche the new plugin one. If not, register the new plugin which will override the previous one in the index.
3476f74 to
ac65001
Compare
Edouard-chin
commented
Mar 2, 2026
| @plugin_paths[name] | ||
| end | ||
|
|
||
| def up_to_date?(spec) |
Contributor
Author
There was a problem hiding this comment.
I opted to create a new method instead of modifying the installed? one, because installed? is also used in the uninstall method. In this case, we don't care about the version of the plugin, we just want to know whether the plugin name exists in the index.
rubygems/bundler/lib/bundler/plugin.rb
Line 64 in 3ab3d47
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.
What was the end-user or developer problem that led to this PR?
When a plugin in the Gemfile is updated to a new version, it will be downloaded but will not be registered. This means that the old version of the plugin will be loaded when Bundler is invoked and the new version is completely ignored.
What is your fix for the problem, implemented in this PR?
Context
The problem is in the
Index#installed?method that only checks for the plugin name in the index. If it finds one, it skips the registration.Solution
Check whether the registed plugin load paths matche the new plugin one. If not, register the new plugin which will override the previous one in the index.
Make sure the following tasks are checked