The error is happening inside ActiveSupport::BufferedLogger#add
method call and you appear to be monkey-patching this class. The internals of ActiveSupport::BufferedLogger
have likely changing between the versions of Rails you're using.
Try removing all of the ActiveSupport::BufferedLogger
code from your environment.rb to work past this error and get your app running. Then, if you still need the monkeypatch (don't know why), you'd have to rewrite it on top of the newer version of the class.