Rails new errors out

I am having an issue with the rails new command. Here is the output of the rails new ookma-kyi-new:

D:\ookma-kyi-core>rails new ookma-kyi-core
      create
      create  README.md
      create  Rakefile
      create  .ruby-version
      create  config.ru
      create  .gitignore
      create  .gitattributes
      create  Gemfile
         run  git init from "."
Initialized empty Git repository in D:/ookma-kyi-core/ookma-kyi-core/.git/
      create  app
      create  app/assets/config/manifest.js
      create  app/assets/stylesheets/application.css
      create  app/channels/application_cable/channel.rb
      create  app/channels/application_cable/connection.rb
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/jobs/application_job.rb
      create  app/mailers/application_mailer.rb
      create  app/models/application_record.rb
      create  app/views/layouts/application.html.erb
      create  app/views/layouts/mailer.html.erb
      create  app/views/layouts/mailer.text.erb
      create  app/assets/images
      create  app/assets/images/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/cable.yml
      create  config/puma.rb
      create  config/storage.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/content_security_policy.rb
      create  config/initializers/cors.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/new_framework_defaults_7_0.rb
      create  config/initializers/permissions_policy.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/master.key
      append  .gitignore
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/apple-touch-icon-precomposed.png
      create  public/apple-touch-icon.png
      create  public/favicon.ico
      create  public/robots.txt
      create  tmp
      create  tmp/.keep
      create  tmp/pids
      create  tmp/pids/.keep
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor
      create  vendor/.keep
      create  test/fixtures/files
      create  test/fixtures/files/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/channels/application_cable/connection_test.rb
      create  test/test_helper.rb
      create  test/system
      create  test/system/.keep
      create  test/application_system_test_case.rb
      create  storage
      create  storage/.keep
      create  tmp/storage
      create  tmp/storage/.keep
      remove  config/initializers/cors.rb
      remove  config/initializers/new_framework_defaults_7_0.rb
         run  bundle install
[11624, #<Thread:0x000001e0bf4b17b0 run>, #<NameError: uninitialized constant Gem::Source

      (defined?(@source) && @source) || Gem::Source::Installed.new
                                           ^^^^^^^^
Did you mean?  Gem::SourceList>, ["E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'", "E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb:1:in `<top (required)>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `require_relative'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `<top (required)>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `require_relative'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `<top (required)>'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli/install.rb:50:in `run'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:255:in `block in install'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:254:in `install'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'", "E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <main>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'", "E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'"]]
[11624, #<Thread:0x000001e0bf4b17b0 run>, #<RuntimeError: CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true>, ["<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `ensure in require'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `require'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb:1:in `<top (required)>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `require_relative'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `<top (required)>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `require_relative'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `<top (required)>'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli/install.rb:50:in `run'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:255:in `block in install'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:254:in `install'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'", "E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <main>'", "E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'", "E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'"]]
E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source': uninitialized constant Gem::Source (NameError)

      (defined?(@source) && @source) || Gem::Source::Installed.new
                                           ^^^^^^^^
Did you mean?  Gem::SourceList
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:26:in `log_error'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:109:in `rescue in with_friendly_errors'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:101:in `with_friendly_errors'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'
<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `ensure in require': CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true (RuntimeError)
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli/install.rb:50:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:255:in `block in install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:254:in `install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <main>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'
<internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `ensure in require': CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true (RuntimeError)
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:167:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb:1:in `<top (required)>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `require_relative'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `<top (required)>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `require_relative'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `<top (required)>'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli/install.rb:50:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:255:in `block in install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:254:in `install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <main>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'
E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source': uninitialized constant Gem::Source (NameError)

      (defined?(@source) && @source) || Gem::Source::Installed.new
                                           ^^^^^^^^
Did you mean?  Gem::SourceList
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:18:in `source'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_ext.rb:50:in `extension_dir'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:339:in `have_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/basic_specification.rb:86:in `contains_requirable_file?'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1038:in `block (2 levels) in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2555:in `block (2 levels) in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2550:in `block in traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:2548:in `traverse'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1034:in `block in find_in_unresolved_tree'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `each'
        from E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/specification.rb:1033:in `find_in_unresolved_tree'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:114:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb:1:in `<top (required)>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `require_relative'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendored_persistent.rb:11:in `<top (required)>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `require_relative'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/fetcher.rb:3:in `<top (required)>'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli/install.rb:50:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:255:in `block in install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/settings.rb:131:in `temporary'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:254:in `install'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:48:in `block in <main>'
        from E:/Ruby31-x64/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
        from E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.3.7/libexec/bundle:36:in `<main>'
         run  bundle binstubs bundler
Resolving dependencies...
       rails  importmap:install
rails aborted!
TZInfo::DataSourceNotFound: tzinfo-data is not present. Please add gem 'tzinfo-data' to your Gemfile and run bundle install
D:/ookma-kyi-core/ookma-kyi-core/config/environment.rb:5:in `<main>'

Caused by:
TZInfo::DataSources::ZoneinfoDirectoryNotFound: None of the paths included in TZInfo::DataSources::ZoneinfoDataSource.search_path are valid zoneinfo directories.
D:/ookma-kyi-core/ookma-kyi-core/config/environment.rb:5:in `<main>'
Tasks: TOP => app:template => environment
(See full trace by running task with --trace)
       rails  turbo:install stimulus:install
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.
You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem.

D:\ookma-kyi-core>

I do have NodeJS installed so not sure what the issue is. Here is my development environment setup:

ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]

Rails 7.0.4

Any ideas?

You are trying to install rails on what is probably an unsupported platform. In this case you have the Universal C Runtime installed in your windows machine, which is causing ruby to try to install the x64-mingw-ucrt version of the necessary gems instead of the normal x64_mingw

The install script is breaking in the tzinfo gem which does not support this runtime. Even if you fix this error, you might get breaks in other places.

I can’t tell you how to fix this problem, but it is generally recommended that windows users use WSDL2 for rails programming.

So rails isn’t supported on windows cause the getting started guide doesn’t mention anything about it?

Should I switch to WSDL2?

Rails is supported on windows, but not with the C runtime you have installed. Your choices are:

  1. Uninstall the UCRT package
  2. Switch to WSDL2
  3. Dual boot a linux distro

Since that package is installed probably because it’s needed by something you have installed, the easiest option is WSDL2 as long as you are on windows 10 or 11. If you are on an older version of windows, dual boot is the only option.

To be honest I don’t even know what the UCRT Runtime is or how it got installed. How do I uninstall UCRT?

Update: I think I managed to get it working by downgrading to Ruby 3.0.4-1 (x64) so it might be an issue with the 3.1.X branch.