Ruby version 2.6.5
gem version 3.0.3
rubygem openssl 2.1.2
It was so strange that when I ran any gem command it threw such error. So I removed and reinstalled Ruby 2.6.5, then the error was gone. Instead, it became a lot “No such file or directory” (ENOENT). I’ll describe it in another thread.
But when I upgraded to v3.0.1 the first time, I got a lot problems installing Ruby gems the version mentioned in Gemfile.lock. I had to install the whole gem rubys in another folder and copied the cache gem files and Gemfile.lock to make it work. So the versions of my gems are somewhat different then the one in tag v3.0.1.
For this TypeError problem, I then solved it by uninstalling ruby 2.6.5 and re-installing it.
Then for the dependencies issues, in github issue 12432 I solved it by reverting everything back and re-install Mastodon v3.0.1 again.
Still have no idea why I failed the dependencies when upgrading to v3.0.1 the first time. Maybe the yarn and gem repositories got some problems at that time and led my instances to a lot of troubles… Anyway starting over everything solved my problems.