Command "istats" gives "-bash: istats: command not found" after "gem install iStats"

Solution 1:

Thanks to historystamp's comment here is how the problem was solved (for bash shell):

  1. Open/Launch Terminal
  2. gem uninstall iStats (source)
  3. gem install iStats --user-install (source)
  4. export PATH="~/.gem/ruby/2.6.0/bin:$PATH" (source)
  5. source ~/.bash_profile (source)
  6. istats

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

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