执行sudo gem install cocoapods出现错误

ERROR:  While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/xcodeproj

这个问题在stackoverflow上面有过讨论:

Can not perform pod install under el capitan (15A279b)
http://stackoverflow.com/questions/32810808/can-not-perform-pod-install-under-el-capitan-15a279b

http://stackoverflow.com/questions/30812777/cannot-install-cocoa-pods-after-uninstalling-results-in-error/30851030#30851030

被采纳的答案为:sudo gem install -n /usr/local/bin cocoapods

As it has been pointed out below, this is a cleaner way of doing it, instead of getting around the Security features of OS X.

sudo gem install -n /usr/local/bin cocoapods

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据