rails: Engine broken after upgrading from Rails 7.1.1 to Rails 7.1.2

Expected behavior

The following engine works in all rails 7 versions up to and including rails 7.1.1 with Ruby 3.2.2 prior to the latest 7.1.2 release

Running my test suite causes the following error


[1] guard(main)> 
08:41:19 - INFO - Run all
08:41:19 - INFO - Running all specs

An error occurred while loading ./spec/models/ccs_cms/admin_dashboard/administrator_spec.rb.
Failure/Error: require File.expand_path('../test/dummy/config/environment', __dir__)

Zeitwerk::NameError:
  expected file /home/jamie/Development/rails/comtech/r7/ccs_cms/engines/admin_dashboard/app/overrides/add_admin_dashboard_link_to_core_header.rb to define constant AddAdminDashboardLinkToCoreHeader, but didn't
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/callbacks.rb:33:in `on_file_autoloaded'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:31:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:91:in `block (2 levels) in enumerate_and_load'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:90:in `block in enumerate_and_load'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:85:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:85:in `enumerate_and_load'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:79:in `load_overrides'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:62:in `block in load_all'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:60:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/environment.rb:60:in `load_all'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/deface-1.9.0/lib/deface/railtie.rb:12:in `activate'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:448:in `instance_exec'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:448:in `block in make_lambda'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:202:in `block (2 levels) in halting'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:707:in `block (2 levels) in default_terminator'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:706:in `catch'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:706:in `block in default_terminator'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:203:in `block in halting'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:598:in `block in invoke_before'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:598:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:598:in `invoke_before'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/callbacks.rb:109:in `run_callbacks'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/reloader.rb:96:in `prepare!'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/application/finisher.rb:74:in `block in <module:Finisher>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `instance_exec'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `run'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:61:in `block in run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:60:in `run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/application.rb:423:in `initialize!'
# ./test/dummy/config/environment.rb:5:in `<top (required)>'
# ./spec/rails_helper.rb:4:in `<top (required)>'
# ./spec/models/ccs_cms/admin_dashboard/administrator_spec.rb:1:in `<top (required)>'`

An error occurred while loading ./spec/requests/ccs_cms/admin_dashboard/dashboard_spec.rb.
Failure/Error: require File.expand_path('../test/dummy/config/environment', __dir__)

FrozenError:
  can't modify frozen Array: ["/home/jamie/Development/rails/comtech/r7/ccs_cms/engines/admin_dashboard/test/dummy/test/mailers/previews"]
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/actionmailer-7.1.2/lib/action_mailer/railtie.rb:83:in `concat'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/actionmailer-7.1.2/lib/action_mailer/railtie.rb:83:in `block in <class:Railtie>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `instance_exec'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `run'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:61:in `block in run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:60:in `run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/application.rb:423:in `initialize!'
# ./test/dummy/config/environment.rb:5:in `<top (required)>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
# ./spec/rails_helper.rb:4:in `<top (required)>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
# ./spec/requests/ccs_cms/admin_dashboard/dashboard_spec.rb:1:in `<top (required)>'

An error occurred while loading ./spec/system/ccs_cms/admin_dashboard/ccs_cms_admin_dashboard_administrators_spec.rb.
Failure/Error: require File.expand_path('../test/dummy/config/environment', __dir__)

FrozenError:
  can't modify frozen Array: ["/home/jamie/Development/rails/comtech/r7/ccs_cms/engines/admin_dashboard/test/dummy/test/mailers/previews"]
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/actionmailer-7.1.2/lib/action_mailer/railtie.rb:83:in `concat'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/actionmailer-7.1.2/lib/action_mailer/railtie.rb:83:in `block in <class:Railtie>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `instance_exec'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `run'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:61:in `block in run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `each'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:50:in `tsort_each_child'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/initializable.rb:60:in `run_initializers'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/application.rb:423:in `initialize!'
# ./test/dummy/config/environment.rb:5:in `<top (required)>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
# ./spec/rails_helper.rb:4:in `<top (required)>'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
# /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
# ./spec/system/ccs_cms/admin_dashboard/ccs_cms_admin_dashboard_administrators_spec.rb:1:in `<top (required)>'
No examples found.

` Also running the Rails Puma Server causes the following error

`rails s
/home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails.rb:51:in `configuration': undefined method `config' for nil:NilClass (NoMethodError)

      application.config
                 ^^^^^^^
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/factory_bot_rails-6.4.0/lib/factory_bot_rails/railtie.rb:25:in `block in <class:Railtie>'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:97:in `class_eval'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:97:in `block in execute_hook'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:77:in `each'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activerecord-7.1.2/lib/active_record/base.rb:338:in `<module:ActiveRecord>'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/activerecord-7.1.2/lib/active_record/base.rb:15:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/database_cleaner-active_record-2.1.0/lib/database_cleaner/active_record/truncation.rb:2:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/database_cleaner-active_record-2.1.0/lib/database_cleaner/active_record.rb:4:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/database_cleaner-active_record-2.1.0/lib/database_cleaner-active_record.rb:1:in `<top (required)>'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `each'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler/runtime.rb:55:in `block in require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `each'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler/runtime.rb:44:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/bundler-2.4.19/lib/bundler.rb:187:in `require'
	from /home/jamie/Development/rails/comtech/r7/ccs_cms/engines/admin_dashboard/test/dummy/config/application.rb:7:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/commands/server/server_command.rb:139:in `block in perform'
	from <internal:kernel>:90:in `tap'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/commands/server/server_command.rb:136:in `perform'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/thor-1.3.0/lib/thor/command.rb:28:in `run'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/thor-1.3.0/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/command/base.rb:178:in `invoke_command'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/thor-1.3.0/lib/thor.rb:527:in `dispatch'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/command/base.rb:73:in `perform'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/command.rb:71:in `block in invoke'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/command.rb:149:in `with_argv'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/command.rb:69:in `invoke'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/commands.rb:18:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/railties-7.1.2/lib/rails/engine/commands.rb:9:in `<top (required)>'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/home/jamie/.rvm/rubies/ruby-3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /home/jamie/.rvm/gems/ruby-3.2.2@cms_admin_dashboard/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
	from bin/rails:14:in `<main>'

` Please see Stackoverflow question https://stackoverflow.com/questions/77516314/how-to-tell-zeitwerk-to-ignore-overrides-folder-in-a-rails-engine?noredirect=1#comment136665688_77516314 in which Xavier @xfn is helping in comments

I will try generating a new engine from scratch to see what happens rather than updating and post back with steps taken or conclusions I come up with

System configuration

Rails version: 7.1.2

Ruby version: 3.2.2

About this issue

  • Original URL
  • State: closed
  • Created 7 months ago
  • Reactions: 3
  • Comments: 39 (22 by maintainers)

Most upvoted comments

@stas awesome, thank you!

@jamesw but, according to the stack trace and https://github.com/thoughtbot/factory_bot_rails/issues/433, don’t you think you are in reality hitting a Factory Bot issue that was even reproduced in Rails 7.0?

Hi. I see same thing with a app.

NoMethodError: undefined method 'config' for nil:NilClass (NoMethodError)

from

versions/3.2.2/lib/ruby/gems/3.2.0/gems/railties-7.1.2/lib/rails.rb:51

from

Bundler.require(*Rails.groups) in config/application.rb

Haven’t looked into it too closely yet or how to reproduce, but just bringing it up that I don’t think whatever this is is is limited to engines.