Nick Dower 2026-04-11 12:08:40 +0000 (Sat, 11 Apr 2026)
New Revision: 11e3c78b61
https://github.com/ruby/ruby/commit/11e3c78b61
Log:
[ruby/rubygems] Fix installing gems with native extensions + transitive dependencies
I am seeing the following error during bundle install:
```
Gem::MissingSpecError: Could not find 'ffi' (>= 1.15.5) among 48 total gem(s) (Gem::MissingSpecError)
```
This is reproducible with:
```ruby
source '
https://rubygems.org'
gem 'llhttp-ffi'
```
It seems only direct dependencies are checked when determining whether
a Gem with native extensions is ready to install. I believe this can
lead to a failure if a transitive dependency is not yet installed.
In the example above, llhttp-ffi depends on ffi-compiler, which depends
on ffi. Since ffi-compiler has no extensions, it is installed
immediately without waiting for ffi. When llhttp-ffi then checks its
direct dependencies, ffi-compiler is already installed, so llhttp-ffi
starts building its native extension. The build requires ffi, which may
not have been installed yet.
https://github.com/ruby/rubygems/commit/a1f5751177
Modified files:
lib/bundler/installer/parallel_installer.rb
spec/bundler/bundler/installer/spec_installation_spec.rb
spec/bundler/commands/install_spec.rb