Today, we’ll talk about an error you would be facing while installing a Ruby Gem into your OS X El Capitan or OS X Sierra.
ERROR: While executing gem … (Errno::EPERM)
This is due to a fact that with OS X El Capitan and Sierra, there is a new security feature called called System Integrity Protection
Well, as I always say, there is always a workaround for your problems. And here is the one for this.
Open your Terminal, and type the below command into your terminal.
sudo gem install -n /usr/local/bin GEM_NAME_HERE
So, if you are going to install Cocoapods then type this command:
sudo gem install -n /usr/local/bin cocoapods
After few seconds, the pod should start installing into your OS X.