I confirmed it. It caused bundle exec ruby couldn't call Bundler.setup.
It's working with that.
$ cat test.rb
#!/usr/bin/env ruby
require "base64"
$ bundle exec test.rb
test.rb:3: warning: base64 will be not part of the default gems since Ruby 3.4.0. Add base64 to your Gemfile. Also contact author of to add base64 into its gemspec.
bundle exec will call Bundler.setup only script that has ruby shebang.
I'm considering how call Bundler.setup via bundle exec ruby.
bundle exec ruby called Bundler.setup. But Gem::BUNDLED_GEMS is not loaded because bundle exec ruby ignore to load gem_prelude.rb. I'm not sure why bundle exec t.rb is load gem_prelude.rb yet.