Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
604 views
in Technique[技术] by (71.8m points)

uninitialized constant Logger::SimpleFormatter (NameError) after upgrading rails to 6.1.0 and ruby 2.7

Tried by including require 'logger', require 'active_support/logger' in application.rb file.

error: /config/application.rb:64:in `class:Application': uninitialized constant Logger::SimpleFormatter (NameError) Did you mean? SimpleDelegator


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Logger::SimpleFormatter was deprecated in rails 4.0, and removed in rails 4.1.

You can use ActiveSupport::Logger::SimpleFormatter instead.

As a general rule, you should never attempt such a large upgrade (v4.0.x --> v6.1.0?!) in one big leap; there are probably countless other errors. Try to go one minor version at a time, and fix deprecations along the way.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...