-
Notifications
You must be signed in to change notification settings - Fork 180
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
Bootsnap loads bundler from gems/ even though version in site_ruby/ is already activated #134
Comments
Yeah, I'm having this issue also with this docker image that has bundler 1.16.0 pre-installed. |
Hi, I removed |
Can you please check if #136 fixes the issue? You can try it with |
@ojab unfortunately no, that did not work. I tried your fork and cleared out the bootsnap cache, and I still get the same error:
|
I've experienced this issue a bunch. However, I'm able to reproduce it even if I haven't ever issued I've got two Dockerfiles in that repro: one issues If I change my |
@cjlarose the ruby-2.3.6-alpine Docker image has two copies of bundler in it. You can see it does a So I think both of your Dockerfiles are actually testing the same scenario. But in any case, that's a really great repro! It shows that anyone using the official Ruby docker image is going to run into this bug. |
@mattbrictson Ah, that makes sense. I looked in
and
on that "single-bundler" image. My load path contains both directories
This explains why removing |
I've also been seeing this crash on my CI jobs. I fixed it by not loading bootsnap in the CI environment:
This works fine for now, but I just realized that I could add the |
This should be fixed in version 1.2.0.pre -- please let me know whether this solves the problem or not. |
Confirmed, this is fixed in 1.2.0.pre! Thanks! 🎉 |
Hi guys. I was hoping this would fix this issue but it didn't I'm still getting this with rake tasks rvm 1.27.0
From the thread linked above, it seems its a bootsnap issue with a relative require somehere? |
based on this, forcibly installing a duplicate copy of the rake gem into the current gemset fixes the problem by preempting the standard + @global gemset copy of rake So I really can't tell if this is an rvm issue or a bootsnap one tbvh. |
Starting with rubygems 2.7.5, Bundler is pre-installed in the
site_ruby
directory. E.g.:You can still
gem install bundler
, at which point you will now have a second copy of Bundler here:Bootsnap can get confused in this scenario, leading it to load bundler again when it has already been loaded. We get lots of warnings about redeclared constants and then Bundler blows up with an error:
Steps to reproduce
Ensure you are running rubygems 2.7.5+
Install bundler
Make a new Gemfile with
bootsnap
in itRun the following ruby script (e.g. in
irb
)This reliably produces:
I believe this is the root cause behind bkeepers/dotenv#321 and also perhaps #103.
The text was updated successfully, but these errors were encountered: