Skip to content

Improve error message when BUNDLED WITH version does not exist - #5205

Merged
deivid-rodriguez merged 4 commits into
masterfrom
use_bundler_installer_to_install_the_bundler_gem
Dec 26, 2021
Merged

deivid-rodriguez merged 4 commits into
masterfrom
use_bundler_installer_to_install_the_bundler_gem

Conversation

@deivid-rodriguez

Copy link
Copy Markdown
Contributor

What was the end-user or developer problem that led to this PR?

We're installing gems using rubygems installer, which makes installation dependent on what's on Gem.sources and does not easily allow us to show a nice error message when the BUNDLED WITH version does not exist.

What is your fix for the problem, implemented in this PR?

Install the bundler gem in the same way other gems are installed from bundler. This allows to easily fix the above issues, but also to use bundler custom gem installer (inherits from Gem::Installer) which for example, does not call Gem::Specification.reset after installing gems or does checksum verification. In general, this way feels better.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez changed the title Improve error message when locked version does not exist Improve error message when BUNDLED WITH version does not exist Dec 22, 2021
Comment thread bundler/lib/bundler/self_manager.rb Resolved
@deivid-rodriguez
deivid-rodriguez force-pushed the use_bundler_installer_to_install_the_bundler_gem branch 4 times, most recently from 238ee31 to 8370d9d Compare December 24, 2021 00:47
@deivid-rodriguez
deivid-rodriguez force-pushed the use_bundler_installer_to_install_the_bundler_gem branch from 8370d9d to 6c6e3c4 Compare December 26, 2021 13:40
This is how bundler installs gem, so we should use the same way for the
bundler gem itself. In particular, Bundler does not use `Gem::Installer`
but a subclass of it that does not call `Gem::Specification.reset` after
install, and that also does some checksum verifications.

This also allows us to:

* Properly verify that the `BUNDLED WITH` version actually exist.
* Not depend on what's on `Gem.sources`.
@deivid-rodriguez
deivid-rodriguez force-pushed the use_bundler_installer_to_install_the_bundler_gem branch from 6c6e3c4 to 0819497 Compare December 26, 2021 20:19
@deivid-rodriguez

Copy link
Copy Markdown
Contributor Author

This improves the error message when locked version does not exist, but also makes the bundler gem installation consistent with how all other gems are installed by bundler, and independent from how RubyGems Gem.sources are configured. So I'll merge it.

@deivid-rodriguez
deivid-rodriguez merged commit bf70808 into master Dec 26, 2021
@deivid-rodriguez
deivid-rodriguez deleted the use_bundler_installer_to_install_the_bundler_gem branch December 26, 2021 22:49
deivid-rodriguez added a commit that referenced this pull request Dec 29, 2021
…ll_the_bundler_gem

Improve error message when `BUNDLED WITH` version does not exist

(cherry picked from commit bf70808)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants