在stackoverflow搜到的解釋是這樣的,This is happening because Apple has enabled rootless on the new install,也就是說在10.11系統上蘋果已經啓用無根的安裝。在這種情況下,如果你使用如下的命令:
sudo gem install cocoa pods -v
就會出現這樣的提示:
ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /usr/bin/pod。
爲了解決上面提到的問題,以及Cocoapods在OS X 10.11系統上的正常使用,我們需要在命令行輸入這樣一句話,
sudo gem install -n /usr/local/bin cocoapods
這樣就能解決Cocoapods在10.11系統上出現的問題了。