Project

General

Profile

Actions

Bug #21806

open

`bundler/inline` generates "uninitialized constant Gem::NameTuple" only when RUBY_BOX=1

Bug #21806: `bundler/inline` generates "uninitialized constant Gem::NameTuple" only when RUBY_BOX=1

Added by sinsoku (Takumi Shotoku) about 6 hours ago. Updated about 3 hours ago.

Status:
Assigned
Target version:
-
ruby -v:
ruby 4.0.0 (2025-12-25 revision 553f1675f3) +PRISM [arm64-darwin25]
[ruby-core:124362]
Tags:

Description

Steps to reproduce

  1. Prepare a file that uses "bundler/inline"
  2. Run with RUBY_BOX=1
# issue.rb
require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"
  gem "json"
end

require "json"
puts JSON::VERSION

Expected behavior

It should run without error.

Actual behavior

uninitialized constant Gem::NameTuple occurs.

$ RUBY_BOX=1 ruby issue.rb
ruby: warning: Ruby::Box is experimental, and the behavior may change in the future!
See https://docs.ruby-lang.org/en/4.0/Ruby/Box.html for known issues, etc.
Fetching gem metadata from https://rubygems.org/.
Retrying fetcher due to error (2/4): NameError uninitialized constant Gem::NameTuple
.
Retrying fetcher due to error (3/4): NameError uninitialized constant Gem::NameTuple
.
Retrying fetcher due to error (4/4): NameError uninitialized constant Gem::NameTuple
.
/Users/sinsoku/.local/share/mise/installs/ruby/4.0.0/lib/ruby/4.0.0/rubygems/specification.rb:2087:in 'Gem::Specification#name_tuple': uninitialized constant Gem::NameTuple (NameError)

    Gem::NameTuple.new name, version, original_platform
       ^^^^^^^^^^^
        from /Users/sinsoku/.local/share/mise/installs/ruby/4.0.0/lib/ruby/4.0.0/bundler/rubygems_ext.rb:277:in 'Gem::Specification#lock_name'
        from /Users/sinsoku/.local/share/mise/installs/ruby/4.0.0/lib/ruby/4.0.0/bundler/checksum.rb:193:in 'Bundler::Checksum::Store#replace'
        from /Users/sinsoku/.local/share/mise/installs/ruby/4.0.0/lib/ruby/4.0.0/bundler/fetcher.rb:182:in 'block (2 levels) in Bundler::Fetcher#specs'
Actions

Also available in: PDF Atom