How do I install RubyGems on my Mac?
I tried to run $ gem install rubygems-update
with no luck . It returns
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Any help would be great. Thanks
It is showing that you don't have the permission to write something in that directory. Instead use this directory :
sudo gem install -n /usr/local/bin cocoapods
It perfectly work for me.
(I am using macOS Sierra, version 10.12.6)
You may have to install manually in which case (as per the official website):
ruby setup.rb
One more variant is to use brew-gem.
https://formulae.brew.sh/formula/brew-gem
https://github.com/sportngin/brew-gem
Just copy/paste from the documentation:
I would highly suggest using a package manager and a Ruby Environment Manager.
On Mac:
You can do that but I suggest using an Environment Manager for Ruby. You have rbenv and RVM.
IMO go for rbenv: