作者:AngryFox 分类: Uncategorized December 9th, 2016 暂无评论

sh-3.2# sudo gem install cocoapods
ERROR: While executing gem … (Errno::EPERM)
Operation not permitted – /usr/bin/xcodeproj、

之前一直在使用的CocoaPods在升级到OS X10.11后突然无法使用,提示以下错误:
-bash: pod: command not found
无奈只能重新安装:
sudo gem install cocoa pods
但奇怪的是重新安装也不成功:
ERROR: While executing gem … (Errno::EPERM)
Operation not permitted – /usr/bin/xcodeproj
一翻搜索,找到解决办法,是要将gem的默认路径重新修改:
$ mkdir -p $HOME/Software/ruby
$ export GEM_HOME=$HOME/Software/ruby
$ gem install cocoapods
[...]
1 gem installed
$ export PATH=$PATH:$HOME/Software/ruby/bin
验证一下,安装成功:
$ pod –version
0.39.0

后来看到另外一种解决办法,也一起收集起来,此方法未亲测。
sudo gem install -n /usr/local/bin cocoa pods
详细内容或讨论可以看这里:

Operation not permitted – /usr/bin/xcodeproj

https://github.com/CocoaPods/CocoaPods/issues/3692