How to Solve brew ERROR in `initialize‘: Version value must be a string; got a NilClass ()

Reason: after MAC is upgraded to MacOS Big Sur system version 11.1, the old version of homebrew is not suitable for the new system, and the message “in ` initialize ‘: version value must be a string” is sent; Got a nilclass() error

Solution:
just update to the latest version of homebrew

$ brew update-reset

Check the version again, OK

$ brew --version
Homebrew 3.1.5-101-gd3013fc

Read More: