-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop setting BUNDLE_PATH
#306
Stop setting BUNDLE_PATH
#306
Conversation
I don't think that folder exists :/
Newer bundler versions install gems to `$GEM_HOME/ruby/<ruby_version>`, instead of directly to `$GEM_HOME`. So we need to add the proper paths to `GEM_PATH` and `PATH` so that gems and their executables are properly found.
Stop setting `BUNDLE_PATH`. All default bundler versions shipped with all supported rubies install gems to `GEM_HOME` by default, so this shouldn't be a breaking change and it's a less surprising behavior because it does not deviate from how bundler is configured by default. Future versions will probably install locally by default, but that hasn't happened yet. I think leaving bundler "unconfigured" also matches the direction of the recent change where the images no longer explicitly install `bundler` but simply leave whatever version comes with ruby. Similarly, it makes sense to me to leave whatever configuration comes by default with `bundler` in place.
Ok, so I was working on this and I realized removing On one hand, it fixes the issue, since it no longer hits the particularly problematic behaviour and restores the previous behaviour. On the other hand, It's simpler and I think deviating from bundler's default configuration has historically confused users. It's also simpler in docker images to set an environment variable than to unset it, so removing Finally, all bundler versions shipped with all supported rubies install gems to Other bundler configurations meant to avoid the creation of a Also, note that the behavior of installing gems globally is expected to change in the future, but it won't happen any time soon, so we'll deal with that when it happens. |
BUNDLE_PATH
Changed the title to reflect the new approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
(Really appreciate the detailed summary and the time spent figuring out the best path forward!! 🤘)
Thanks both for your patience! 💜 |
Changes: - docker-library/ruby@e30082f: Merge pull request docker-library/ruby#306 from deivid-rodriguez/add_path_scoped_to_ruby_version_to_path_and_gem_path - docker-library/ruby@82eecb7: Alternative fix - docker-library/ruby@7df74ad: Add paths scoped to ruby version to PATH and GEM_PATH - docker-library/ruby@8f3650c: Remove unnecessary PATH modification
With changes from docker-library/ruby#306 This commit also reverts a999d22
@tianon do you happen know when we might expect to see this change in the images on Docker Hub? My understanding is a PR must be raised against docker-library/official-images. If there's no plan to do that at the moment, and it's open for anyone to do, I'd be happy to volunteer myself. |
Thanks for all your work on this @deivid-rodriguez! :) |
You're welcome! Also thanks @jimeh for the super useful input :) |
@deivid-rodriguez you did all the heavy lifting, I just butted in with annoying questions from time to time :D... thanks for all your effort :) |
This PR broke our CI builds :( |
I'm sorry that happened @slayer. I wasn't expecting anything to break, but this is not a perfect world as experience keeps proving. Can you elaborate a bit more what happened? I'm pretty confident this is the right direction to take for the official images, but I'd still like to hear about your situation to see if there's something we should be changing. |
It is non critical, I have already fixed our We used |
Oh, I see. So the command became invalid when removing the |
So I understand it correct that these changes are not yet live in the official images, are they? I can still see the issue with |
They were updated a while ago. The issue you're having is that only the latest patch level version of each ruby is officially maintained and receives patches. So in addition to the mentioned workarounds, you could upgrade to ruby-2.6.5.
|
previously we had to because of these bugs: bundler: - rubygems/bundler#6162 - rubygems/bundler#6154 cruby docker: - docker-library/ruby#209 - docker-library/ruby#306 jruby docker: - jruby/docker-jruby#65 - https://github.com/cpuguy83/docker-jruby/pull/67/files
* Update examples from "ruby:3.0" to "ruby:3.3" Previous: #2051 3.0 images are not build/updated anymore * Drop mentions of unused bundler env variables for ruby Dropped in: * docker-library/ruby#209 * docker-library/ruby#306
Newer bundler versions install gems to
$GEM_HOME/ruby/<ruby_version>
, instead of directly to$GEM_HOME
.So we need to add the proper paths to
GEM_PATH
andPATH
so that gemsand their executables are properly found.
This is the proposal to fix rubygems/bundler#7494.
These changes are expected to be fully backwards compatible and should pass all the smoke tests to be added to https://github.com/docker-library/official-images:
--deployment
flag check to ruby-bundler test official-images#7188.