Install Gems Without sudo in macOS
I came across a neat little command line tool via Rob Griffiths’ Robservatory this morning, a Ruby gem named iStats1. Install is easy enough in Rob’s example,
sudo gem install iStats, except that when you use
sudo to install gems you are using the default macOS Ruby, and installing to system paths.