-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Bundler should give a better error when the Gemfile itself activates a conflicting gem #7178
Comments
We should be supporting gemfied set since Bundler 2.2.8, which first included #4297. Would it be possible that you are using an older Bundler? |
I don't think so. My Gemfile.lock was built with
|
Not a good guess then, thanks for confirming. Please provide repro steps so that we can take a look at this. |
I'm having trouble finding ways to describe how to reproduce the issue without linking to our specific code or our specific images. I do have this which shows the docker versions we are using - the base image has
|
Maybe extracting only dependency manifests to a separate repository, removing your private code and private gems, and see if it still reproduces? |
I have suddenly started seeing this problem on a new machine, but I'm having trouble creating another copy of the repo with the same problem. The symptom I can observe is this error during Bundler.setup:
The error only appears when installing to system gems, so I can make it appear and disappear repeatedly by running My system gems include both the locked version of
|
oh no 🤦🏻 I figured it out. my Rails app contains a (relatively) complicated gemfile that loads some ruby to evaluate whether to include other gems. The "configuration" class has this at the top:
Turns out We should probably turn this into one of the advanced Bundler error messages, and say something like this:
Maybe this is also an opportunity for us to overwrite |
The good news is that figuring all of this out suggests a workaround:
I have tested this on my example app, and it seems to work. |
The idea of giving a better error message when a |
I made a branch with a failing test for this case. I'm not confident about its approach, but it does trigger the error: https://github.com/rubygems/rubygems/compare/require-conflict-in-gemfile |
I have been having trouble with a docker setup that was failing due to a mismatch in the `set` gem. The issue on github is here: rubygems/rubygems#7178 The intention of this repo is to provide a small test case that will demonstrate the problem I am having.
Hi this repo https://github.com/modolabs/bundler-set-error-example should demonstrate the issue I am having. It seems like it might have something to do with If these commands are executed in that repo, the error will occur for me
|
In your case, you're using a very old spring version that does not include rails/spring#659, that's why you run into this error. If you upgrade (or remove) spring, you should be fine! |
This might be a separate issue, but I ran into a similar issue with the
Consider this source 'https://rubygems.org'
gem 'uri', '= 0.12.2'
gem 'test', path: 'test' In # frozen_string_literal: true
Gem::Specification.new do |s|
s.name = "test"
s.version = "1.0.0"
s.summary = "test"
s.authors = ['John Doe']
s.homepage = 'https://example.com'
end If I simply run
In this example, the user doesn't have a whole lot of control over the loading of The only workaround I can see is to update |
Yeah, we should vendor the |
Closed unintentionally by #7386. Reopening. |
After updating to Rails 7.1 we started receiving an error:
The cause was Spring. After disabling it the error is gone, but investigating the reason was hard. It would be better if we had a clearer error message. |
FYI, we were receiving the following error:
What worked was manually install sudo gem install strscan:3.1.0 This ensures that one is used instead of the default 3.0.7: gem list strscan
*** LOCAL GEMS ***
strscan (3.1.0, default: 3.0.7) I tried other methods before doing this that I saw elsewhere, including:
Neither worked. I did get it working by pinning my version of Hope that helps others. |
I have been running into a strange situation which I believe is due to differing versions of the built-in gem
set
in different docker images.My application runs on ruby 3.0.6 currently. My CI is CircleCI, and I use the
cimg/ruby:3.0.6-browsers
which appears to useset:1.0.3
However my devops team is running my application on Docker, usingruby:3.0.6alpine3.16
which appears to useset:1.0.1
Whichever of those versions I specify in
Gemfile.lock
will cause an error similar to this:Similar things have happened to me on other projects that use more up-to-date versions of ruby.
I would have expected that bundler would be able to force the use of the version of the gem in Gemfile.lock, it hadn't occurred to me that I would need to inspect which versions were built-in to my images.
The text was updated successfully, but these errors were encountered: