Comments (2)
Thanks for the nice investigation @wata727. I was able to reproduce the problem. It's not expected that Bundler fails to auto switch to the proper version in your case (binstubs + local bundler path). I created #7719 to fix this problem.
from rubygems.
It seems to be an issue caused by #7560.
First of all, in my environment, the version of Bundler installed on the system and the version of Bundler installed in vendor/bundle
are different:
# cat .bundle/config
---
BUNDLE_CLEAN: "true"
BUNDLE_PATH: "vendor/bundle"
# cat test.rb
require "bundler"
puts Bundler::VERSION
# ruby test.rb
2.4.19
# bundle exec ruby test.rb
2.5.11
In this situation, if you call a binstub that does require "bundler/setup"
, an authenticated gem (e.g. sidekiq-pro) will not load:
# DEBUG=true bin/rails
Could not find gem 'sidekiq-pro' in locally installed gems
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:910:in `block in verify_changed_sources!'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:908:in `each'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:908:in `verify_changed_sources!'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:899:in `source_requirements'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:513:in `resolution_packages'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:495:in `resolver'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:570:in `start_resolution'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:301:in `resolve'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:523:in `materialize'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:200:in `specs'
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:266:in `specs_for'
/usr/local/lib/ruby/3.2.0/bundler/runtime.rb:18:in `setup'
/usr/local/lib/ruby/3.2.0/bundler.rb:162:in `setup'
/usr/local/lib/ruby/3.2.0/bundler/setup.rb:10:in `block in <top (required)>'
/usr/local/lib/ruby/3.2.0/bundler/ui/shell.rb:159:in `with_level'
/usr/local/lib/ruby/3.2.0/bundler/ui/shell.rb:111:in `silence'
/usr/local/lib/ruby/3.2.0/bundler/setup.rb:10:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
/app/config/boot.rb:3:in `<top (required)>'
/app/bin/rails:4:in `require_relative'
/app/bin/rails:4:in `<top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/rails.rb:28:in `load'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/rails.rb:28:in `call'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/command.rb:7:in `call'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client.rb:30:in `run'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/bin/spring:49:in `<top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/binstub.rb:11:in `load'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/binstub.rb:11:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
/app/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/app/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'
Run `bundle install` to install missing gems.
Setting frozen=true
makes the cause obvious. It seems that a gem cannot be resolved because Gemfile.lock
is rewritten by Bundler v2.4.19 (not v2.5.11).
# bundle config set --local frozen true
# DEBUG=true bin/rails
The list of sources changed, but the lockfile can't be updated because frozen mode is set
You have changed in the Gemfile:
* sidekiq-ent from `rubygems repository https://enterprise.contribsys.com/` to `rubygems repository https://<REDACTED>@enterprise.contribsys.com/`
* sidekiq-pro from `rubygems repository https://enterprise.contribsys.com/` to `rubygems repository https://<REDACTED>@enterprise.contribsys.com/`
Run `bundle install` elsewhere and add the updated Gemfile.lock to version control.
If this is a development machine, remove the Gemfile freeze by running `bundle config set frozen false`.
/usr/local/lib/ruby/3.2.0/bundler/definition.rb:418:in `ensure_equivalent_gemfile_and_lockfile'
/usr/local/lib/ruby/3.2.0/bundler/runtime.rb:13:in `setup'
/usr/local/lib/ruby/3.2.0/bundler.rb:162:in `setup'
/usr/local/lib/ruby/3.2.0/bundler/setup.rb:10:in `block in <top (required)>'
/usr/local/lib/ruby/3.2.0/bundler/ui/shell.rb:159:in `with_level'
/usr/local/lib/ruby/3.2.0/bundler/ui/shell.rb:111:in `silence'
/usr/local/lib/ruby/3.2.0/bundler/setup.rb:10:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
/app/config/boot.rb:3:in `<top (required)>'
/app/bin/rails:4:in `require_relative'
/app/bin/rails:4:in `<top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/rails.rb:28:in `load'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/rails.rb:28:in `call'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client/command.rb:7:in `call'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/client.rb:30:in `run'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/bin/spring:49:in `<top (required)>'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/binstub.rb:11:in `load'
/app/vendor/bundle/ruby/3.2.0/gems/spring-4.2.1/lib/spring/binstub.rb:11:in `<top (required)>'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
<internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
/app/bin/spring:10:in `block in <top (required)>'
<internal:kernel>:90:in `tap'
/app/bin/spring:7:in `<top (required)>'
bin/rails:2:in `load'
bin/rails:2:in `<main>'
from rubygems.
Related Issues (20)
- Improve handling of paths with colons (allowed on Unix, disallowed on Windows) HOT 6
- Support CompactIndex API for FIPS HOT 5
- bundler/inline gets confused when run in a directory with a cached bundle HOT 4
- Strange `/` append and config line duplication with `bundle config` upon overwrites
- bundle gem --ext=rust does not install well as a gem out of the box HOT 4
- Bundler 2.5.11 raises runtime errors on Truffleruby HOT 6
- NoMethodError: undefined method `+' for nil:NilClass HOT 6
- Reduce friction for newly created gems HOT 14
- `bundle lock --add-platform windows` prints a warning and adds `unknown` HOT 4
- error in bundler cannot continye
- Inconsistent platforms inserted into Gemfile.lock HOT 2
- ruby-core CI is failing: Failure/Error: expect(out).to match(/\A1 : rack\n2 : rack-obama\n0 : - exit -(\n>.*)?\z/) HOT 1
- Specifying both a version and Git-related attributes when a .gemspec exists HOT 1
- Validation runs twice on bundle commands HOT 1
- Adding `sorbet` causes `bundle install` to freeze while resolving dependencies HOT 3
- wdm refuses to install on windows 10 HOT 1
- Only on Windows, the default gem is preferred over the installed gem HOT 3
- Bundler hanging on acquiring lock HOT 2
- Alter default bundled gems
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rubygems.