From 5bca28cd94029eb5f0be4789beae248cf92b1dd2 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 17 Jan 2025 00:06:23 +0900 Subject: [PATCH] require logger before requiring rails require 'rails' fails with the following error on Rails 6 > uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError) --- test/test_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 285c93f..8af433c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -4,6 +4,8 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) +# require logger before rails or Rails 6 fails to boot +require 'logger' # load Rails first require 'rails' require 'active_record'