13c99ffab9 (master): Fix autoload's require dispatch under Ruby::Box

0 views
Skip to first unread message

Hiroshi SHIBATA

unread,
7:19 PM (5 hours ago) 7:19 PM
to ruby...@g.ruby-lang.org
Hiroshi SHIBATA 2026-08-27 10:05:22 +0000 (Thu, 27 Aug 2026)

New Revision: 13c99ffab9

https://github.com/ruby/ruby/commit/13c99ffab9

Log:
Fix autoload's require dispatch under Ruby::Box

With RUBY_BOX=1, firing an autoload invoked Ruby::Box#require on the
registered box, bypassing any Kernel#require decoration (RubyGems,
Zeitwerk, ...) prepended in that box. Zeitwerk's implicit namespaces
rely on the decorated require, so a plain Rails app failed with
LoadError on the first request. Call require on the box's top self in
a frame running in that box instead, which dispatches the decorated
method and still loads the feature into the box that registered the
autoload.

Modified files:
test/ruby/test_box.rb
variable.c
Reply all
Reply to author
Forward
0 new messages