You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Calling DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call DidYouMean.correct_error(error_name, spell_checker)' instead." #5234
Looks like any lockfile with a Bundler version below 2.3.3 (and recent enough to include the offending code) will print the
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
warning when using Ruby 3.1 that ships with did_you_mean 1.6.1 that has deprecated access to DidYouMean::SPELL_CHECEKRS
I see this has been addressed by 1074771 but is there anything that can be done for old versions? I guess this is a side-effect of the automatic bundler version switching introduced in Bundler 2.3.
Maybe Bundler should always print something when auto-switching? Then it would be a bit more obvious why you see the deprecation message (and it is probably useful in other scenarios too).
Post steps to reproduce the problem
$ bundler -v
Bundler version 2.3.3
$ bundle init
Writing new Gemfile to /Users/dentarg/test/Gemfile
$ gem install bundler -v 2.2.33
Fetching bundler-2.2.33.gem
Successfully installed bundler-2.2.33
1 gem installed
$ cat Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
PLATFORMS
x86_64-darwin-19
DEPENDENCIES
BUNDLED WITH
2.2.33
$ bundle install
Bundler 2.3.3 is running, but your lockfile was generated with 2.2.33. Installing Bundler 2.2.33 and restarting using that version.
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
The Gemfile specifies no dependencies
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
$ bundle list
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
No gems in the Gemfile
What were you expecting to happen?
No warning printed.
What actually happened?
Warning printed.
Reacted by Stefan Kaes, Johan Eckerström, Michael Scrivo, Louis Larpin, Robert Shecter, Amer Jazaerli, Quentin Rousseau, Philippe de Liedekerke, Danila Poyarkov, James Klein and 50 more
Yeah, this was very unfortunate and I can see how it's annoying. The warning came up very close to the release, and we only had time to fix it, but not to become aware of how the feature of auto-installing the locked version and auto-switching to it on the fly would play with it.
If I understood your suggestion properly, it is that we always log something when bundler auto-switches (by auto-switching I mean activating the locked version of bundler if available instead of the latest version). I think that might be too verbose and annoying. It would force users to upgrade all their apps to be locked to the latest bundler version installed in their system if they want to avoid this message being printed on every bundler invocation. It sounds like too much.
Something I would've done if I had realized about this issue beforehand (I even considered it without knowing about this issue) is to limit this new feature to lockfiles generated with bundler versions >= 2.3, so that existing lockfiles get no behavioral change at all. I guess it won't have the desired effect now since ruby 3.1 is already out, but might be a good idea anyways? Not %100 sure.
It's also really unfortunate to have introduced #5221 with the release, so it makes the recommended way out of this not work. Anyways, the fix for that will be released very soon.
I'll be releasing bundler 2.3.4 now, so that at least the easy way out of this warning, i.e., running bundle update --bundler, works again.
I'm also considering limiting auto-switching to Gemfile.lock files locked to bundler >= 2.3 but at this point I think it's not worth it. Ruby 3.1 including did_you_mean 1.6.1 and bundler 2.3.3 is already out. So this warning will appear by default on Gemfile.lock files locked to older bundler versions. So to fix the warning, user action is required anyways.
Reacted by Yaro Shm, Tej Kashi, remcode-remco, Eugen, Ralph, &MF#CTg*fWz6H^nV, agentdon, Rodrigo Reyes, Luiz F. Picolo, Jono Feist and 44 more
Reacted by Tej Kashi, OXOOOOE9XD, Fernando Basso, vova865, Ari Karim, Cleber Oliveira, doanld-0752, __stan__, KarmoDDrine, Brandon Welsch and 5 more
Also, just to make sure there's an easy way out of this posted here, running
bundle _2.3.3_ update --bundler
should update your lockfile to use bundler 2.3.3 and get you out of this warning. Plain bundle update --bundler does not work due to a regression that will be fixed by bundler 2.3.4.
EDIT: I released bundler 2.3.4, so if you install that (gem install bundler), now bundle update --bundler should be enough to get rid of the warning. In future bundler versions (hopefully the next one), you won't need a previous gem install bundler step to update the version of bundler your application uses to the latest version.
Reacted by Matthias Orgler, Azdren, Abhiman Tiwari, Thiago Portella, Vineel Sonnathi, Junzhe, Tom Pritchard, Andy Huynh, Tom Harrison, Serge Hänni and 41 more
Reacted by Erik Westrup, Adrian Debbeler, Azdren, Thiago Portella, Tom Pritchard, Andy Huynh, Serge Hänni, Jason Yavorsky, Erik Tailor, godekdls and 17 more
If I understood your suggestion properly, it is that we always log something when bundler auto-switches (by auto-switching I mean activating the locked version of bundler if available instead of the latest version). I think that might be too verbose and annoying. It would force users to upgrade all their apps to be locked to the latest bundler version installed in their system if they want to avoid this message being printed on every bundler invocation. It sounds like too much.
Sure, I get it could be too much.
Is it possible to run Bundler in some sort of debug/verbose mode? So one can follow what's happening.
Even bundler -v will say Bundler version 2.2.33 when you are in a folder where there's a lockfile with BUNDLED WITH set to 2.2.33. But if you aren't in such a folder, but have both Bundler 2.3.3 and 2.2.33 installed, bundler -v will say Bundler version 2.3.3. I suspect in the lockfile case, Bundler auto-switched before printing the version string, despite Bundler 2.3.3 being invoked?
Even bundler -v will say Bundler version 2.2.33 when you are in a folder where there's a lockfile with BUNDLED WITH set to 2.2.33. But if you aren't in such a folder, but have both Bundler 2.3.3 and 2.2.33 installed, bundler -v will say Bundler version 2.3.3. I suspect in the lockfile case, Bundler auto-switched before printing the version string, despite Bundler 2.3.3 being invoked?
Yes, this is the expected behavior. If you're in an application context, RubyGems chooses the locked version of Bundler in the Gemfile.lock file when you run bundle (if present). If you are outside of an application context, RubyGems chooses the latest version of Bundler available in the system. This has been a feature of RubyGems for 4 years now. Note that in an application context, Bundler 2.3.3 is not invoked at all in this case. RubyGems activates the 2.2.33 version directly. That's why bundle -v prints 2.2.33 correctly.
What we have changed now, is that even if the exact version of Bundler is not present in the system before running bundle , and thus RubyGems falls back to choosing the latest version, bundle install will install the locked version first, and then restart itself, so that RubyGems now has the opportunity to choose the locked version directly.
Hope this makes sense.
Is it possible to run Bundler in some sort of debug/verbose mode? So one can follow what's happening.
We have a --verbose flag, that in particular logs something like
Running bundle install --verbose with bundler 2.3.3
right after start. However, Bundler keeps a list of "parseable commands" (for example, --version) that skip this message at all.
Not sure if skipping this message in --verbose mode is a good idea. To be honest, I don't really consider the output of any command "parsable", let alone if --verbose is given. But it's how it works now 🤷.
I'm still getting the warning after installing bundler 2.3.4 and running bundle update --bundler as suggested by @deivid-rodriguez
Edit: I'm getting the warning when I run rails -v
Reacted by Alexander Mamrenko, Daniel Martin, Robert Woolley, Shozo Hatta, Jasper Furniss , Yeonmun Jeong and anchit-desai
Activity
deivid-rodriguez commentedon Dec 29, 2021
Hi!
Yeah, this was very unfortunate and I can see how it's annoying. The warning came up very close to the release, and we only had time to fix it, but not to become aware of how the feature of auto-installing the locked version and auto-switching to it on the fly would play with it.
If I understood your suggestion properly, it is that we always log something when bundler auto-switches (by auto-switching I mean activating the locked version of bundler if available instead of the latest version). I think that might be too verbose and annoying. It would force users to upgrade all their apps to be locked to the latest bundler version installed in their system if they want to avoid this message being printed on every bundler invocation. It sounds like too much.
Something I would've done if I had realized about this issue beforehand (I even considered it without knowing about this issue) is to limit this new feature to lockfiles generated with bundler versions >= 2.3, so that existing lockfiles get no behavioral change at all. I guess it won't have the desired effect now since ruby 3.1 is already out, but might be a good idea anyways? Not %100 sure.
It's also really unfortunate to have introduced #5221 with the release, so it makes the recommended way out of this not work. Anyways, the fix for that will be released very soon.
hsbt commentedon Dec 29, 2021
/cc @yuki24
deivid-rodriguez commentedon Dec 29, 2021
I'll be releasing bundler 2.3.4 now, so that at least the easy way out of this warning, i.e., running
bundle update --bundler, works again.I'm also considering limiting auto-switching to
Gemfile.lockfiles locked tobundler >= 2.3but at this point I think it's not worth it. Ruby 3.1 including did_you_mean 1.6.1 and bundler 2.3.3 is already out. So this warning will appear by default onGemfile.lockfiles locked to older bundler versions. So to fix the warning, user action is required anyways.deivid-rodriguez commentedon Dec 29, 2021
Also, just to make sure there's an easy way out of this posted here, running
should update your lockfile to use bundler 2.3.3 and get you out of this warning. Plain
bundle update --bundlerdoes not work due to a regression that will be fixed by bundler 2.3.4.EDIT: I released bundler 2.3.4, so if you install that (
gem install bundler), nowbundle update --bundlershould be enough to get rid of the warning. In future bundler versions (hopefully the next one), you won't need a previousgem install bundlerstep to update the version of bundler your application uses to the latest version.dentarg commentedon Dec 29, 2021
Sure, I get it could be too much.
Is it possible to run Bundler in some sort of debug/verbose mode? So one can follow what's happening.
Even
bundler -vwill sayBundler version 2.2.33when you are in a folder where there's a lockfile withBUNDLED WITHset to2.2.33. But if you aren't in such a folder, but have both Bundler 2.3.3 and 2.2.33 installed,bundler -vwill sayBundler version 2.3.3. I suspect in the lockfile case, Bundler auto-switched before printing the version string, despite Bundler 2.3.3 being invoked?deivid-rodriguez commentedon Dec 29, 2021
Yes, this is the expected behavior. If you're in an application context, RubyGems chooses the locked version of Bundler in the
Gemfile.lockfile when you runbundle(if present). If you are outside of an application context, RubyGems chooses the latest version of Bundler available in the system. This has been a feature of RubyGems for 4 years now. Note that in an application context, Bundler 2.3.3 is not invoked at all in this case. RubyGems activates the 2.2.33 version directly. That's whybundle -vprints 2.2.33 correctly.What we have changed now, is that even if the exact version of Bundler is not present in the system before running
bundle, and thus RubyGems falls back to choosing the latest version,bundle installwill install the locked version first, and then restart itself, so that RubyGems now has the opportunity to choose the locked version directly.Hope this makes sense.
We have a
--verboseflag, that in particular logs something likeright after start. However,
Bundlerkeeps a list of "parseable commands" (for example,--version) that skip this message at all.deivid-rodriguez commentedon Dec 29, 2021
Not sure if skipping this message in
--verbosemode is a good idea. To be honest, I don't really consider the output of any command "parsable", let alone if--verboseis given. But it's how it works now 🤷.yuki24 commentedon Dec 31, 2021
Apologies for the trouble this has caused. Is there anything I can do to mitigate the impact of the deprecation message?
zchrb commentedon Dec 31, 2021
I'm still getting the warning after installing
bundler 2.3.4and runningbundle update --bundleras suggested by @deivid-rodriguezEdit: I'm getting the warning when I run
rails -vdmartinatdu commentedon Jan 2, 2022
Similarly, I've followed directions to install bundler 2.3.4 and run bundle update --bundler, still seeing the error message.
robertwoolley99 commentedon Jan 2, 2022
..At the risk of sound AOL-like from 1994 - me too. Sorry.
mensfeld commentedon Jan 2, 2022
@dmartinatdu you may be seeing it because despite installing newer version, old one is used to install your dependencies.
robertwoolley99 commentedon Jan 2, 2022
@mensfeld I've removed all versions of bundler except 2.3.4 - still getting the warning. Viz:
mensfeld commentedon Jan 2, 2022
@robertwoolley99 what about
bundler --versionin the project root dir?41 remaining items
xiehui999 commentedon Dec 5, 2022
+1
bundle update --bundler
Bump bundler to 2.4.6
Alireza12120 commentedon Mar 11, 2023
چرا زمان نصب متاسپلویت ارور میدهدGem::Ext::BuildError: ERROR: Failed to build gem native extension؟
sonm-usui commentedon May 19, 2023
for me, I changed the ruby version from
2.7.0to3.2.0and it works for meSwitch to newest bundler to get rid of annoying warning ruby/rubygems…
synth commentedon Oct 24, 2023
#5234 (comment)
this tipped me to updating thor:
bundle update thor- going from 1.1.0 to 1.3.0 cleared this for me.Avoid DidYouMean deprecation message
Update bundler
chore: update Bundler
Update bundler
Update Bundler to v2.3.4
Update Bundler to v2.3.4 (#9)
chore: bump bundler from 2.2.22 to 2.4.9
fix github action error ruby/rubygems#5234