I have a similar problem, and it is solved using the 2nd solution, try to execute these commands either in solutions 1 or 2 on the terminal
I am running osx 10.12.1
ERROR: while executing gem ... (Errno :: EPERM) Operation not allowed - / usr / bin / pod
Solution 1:
Step 1: sudo nvram boot-args="rootless=0"
Step 2: sudo reboot
Step 3: sudo gem install cocoapods -V
Solution 2:
step 1: sudo gem install -n /usr/local/bin cocoapods
Step 2: pod setup
source share