Command "istats" gives "-bash: istats: command not found" after "gem install iStats"
Thanks to historystamp's comment here is how the problem was solved (for bash shell):

Open/Launch Terminal
gem uninstall iStats (source)
gem install iStats --user-install (source)
export PATH=&quot;~/.gem/ruby/2.6.0/bin:$PATH&quot; (source)
source ~/.bash_profile (source)
istats

If you use macOS Catalina, the default shell is zsh. The adapted instructions are the following:

Open/Launch Terminal
gem uninstall iStats (source)
gem install iStats --user-install (source)
Open or create ~/.zshrc
At the end of the file (or where appropriate) insert: export PATH=~/.gem/ruby/2.6.0/bin:$PATH (source)
Save file ~/.zshrc
Source the .zshrc file: . ~/.zshrc (source)
istats