0

I tried to install a gem with gem install test-unit and get the same error each time.

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
simotu
  • 1
  • 1
  • Install RVM with `\curl -sSL https://get.rvm.io | bash -s stable`; restart your shell; install Ruby with `rvm install 2.7`. [Don't](https://robots.thoughtbot.com/psa-do-not-use-system-ruby) [use](https://chrisherring.co/posts/why-you-shouldn-t-use-the-system-ruby) [system Ruby](http://billpatrianakos.me/blog/2014/05/15/never-use-system-ruby-ever/). Then retry your `gem install` operation. – anothermh Apr 15 '20 at 02:40
  • Possible duplicate of https://stackoverflow.com/questions/18599889/error-while-executing-gem-gemfilepermissionerror – Josh Brody Apr 15 '20 at 02:41
  • @JoshBrody The top voted answer is wrong as pointed out by the comments, and it's not really a duplicate as the linked question had a broken RVM installation and this user has system Ruby only. – anothermh Apr 15 '20 at 02:52
  • 1
    You either `sudo gem install` or use an `rbenv` or RVM provided personal Ruby. – tadman Apr 15 '20 at 06:24

0 Answers0