So I've read every post on how to stop sudo installing gems and there's literally 100's of different answers and one still hasn't struck as gold yet. Can someone, once and for all, offer the most simple and concise manner in which to edit and update your bash profile to rewrite permissions and stop sudo installing gems?
Below is just an example to show you what I get every time. For the past few weeks, I've just been doing everything and I know this is putting a band-aid over the problem.
LMagnotti$ gem install nokogiri
ERROR: While executing gem ... (Errno::EACCES)
Permission denied @ rb_sysopen - /usr/local/lib/ruby/gems/2.3.0/gems/nokogiri-1.6.7.2/.autotest