ruby / ruby/rubygems

Bundler 4.0.1 trying to find gem for every platform

Open
#9,176 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

Describe the problem as clearly as you can

When running a rails generator within a Bundle.with_unbundled_env we get this error: (see https://github.com/projectblacklight/blacklight/actions/runs/20079840341/job/57603875568?pr=3783). This was not a problem when using bundler 2.

       rails  importmap:install
/opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:356:in 'Bundler::Resolver#raise_not_found!': Could not find gems matching 'sqlite3 (>= 2.1)' valid for all resolution platforms (aarch64-linux-gnu, aarch64-linux-musl, arm-linux-gnu, arm-linux-musl, arm64-darwin, x86_64-darwin, x86_64-linux-gnu, x86_64-linux-musl, x86_64-linux) in locally installed gems. (Bundler::GemNotFound)

The source contains the following gems matching 'sqlite3 (>= 2.1)':
  * sqlite3-2.8.1-x86_64-linux-gnu
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:450:in 'block in Bundler::Resolver#prepare_dependencies'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:425:in 'Hash#each'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:425:in 'Enumerable#filter_map'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:425:in 'Bundler::Resolver#prepare_dependencies'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:63:in 'Bundler::Resolver#setup_solver'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/resolver.rb:28:in 'Bundler::Resolver#start'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/definition.rb:755:in 'Bundler::Definition#start_resolution'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/definition.rb:350:in 'Bundler::Definition#resolve'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/definition.rb:668:in 'Bundler::Definition#materialize'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/definition.rb:240:in 'Bundler::Definition#specs'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/definition.rb:312:in 'Bundler::Definition#specs_for'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/runtime.rb:18:in 'Bundler::Runtime#setup'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler.rb:165:in 'Bundler.setup'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/setup.rb:32:in 'block in <top (required)>'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/ui/shell.rb:177:in 'Bundler::UI::Shell#with_level'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/ui/shell.rb:122:in 'Bundler::UI::Shell#silence'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/gems/3.4.0/gems/bundler-4.0.1/lib/bundler/setup.rb:32:in '<top (required)>'
	from <internal:/opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
	from <internal:/opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
	from /opt/hostedtoolcache/Ruby/3.4.7/x64/lib/ruby/3.4.0/rubygems.rb:1417:in '<top (required)>'
	from <internal:gem_prelude>:2:in 'Kernel#require'
	from <internal:gem_prelude>:2:in '<internal:gem_prelude>'
Did you try upgrading rubygems & bundler?

Yes

Post steps to reproduce the problem

Run any build in

Which command did you run?

rails importmap:install

What were you expecting to happen?

the generator runs

What happened instead?

see stacktrace from above.

Replace this with the actual result you got. Paste the output of your command here.
If not included with the output of your command, run bundle env and paste the output below

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bundler/resolver.rb, especially Resolver#prepare_dependencies and the resolution path reached by Bundle.with_unbundled_env. Reproduce the rails importmap:install command with Bundler 4.0.1 and the installed sqlite3 platform shown in the report. Done means the generator runs without requiring sqlite3 gems for every listed resolution platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.