OS X 10.11上升级CocoaPods出错了

➜  ~  sudo gem install cocoapods
Fetching: nap-1.0.0.gem (100%)
Successfully installed nap-1.0.0
Fetching: molinillo-0.4.0.gem (100%)
Successfully installed molinillo-0.4.0
Fetching: cocoapods-try-0.5.1.gem (100%)
Successfully installed cocoapods-try-0.5.1
Fetching: cocoapods-stats-0.6.2.gem (100%)
Successfully installed cocoapods-stats-0.6.2
Fetching: cocoapods-search-0.1.0.gem (100%)
Successfully installed cocoapods-search-0.1.0
Fetching: xcodeproj-0.28.2.gem (100%)
ERROR:  While executing gem ... (Errno::EPERM)
    Operation not permitted - /usr/bin/xcodeproj
➜  ~  sudo gem install -n /usr/local/bin cocoapods

报错:ERROR: While executing gem ... (Errno::EPERM)

Operation not permitted - /usr/bin/xcodeproj  说是执行gem的时候某个操作不被允许,没有权限

输入以下命令即可解决

➜  ~  sudo gem install -n /usr/local/bin cocoapods
Password:
Successfully installed xcodeproj-0.28.2
Fetching: cocoapods-core-0.39.0.gem (100%)
Successfully installed cocoapods-core-0.39.0
Fetching: cocoapods-0.39.0.gem (100%)
Successfully installed cocoapods-0.39.0
Parsing documentation for xcodeproj-0.28.2
Installing ri documentation for xcodeproj-0.28.2
Parsing documentation for cocoapods-core-0.39.0
Installing ri documentation for cocoapods-core-0.39.0
Parsing documentation for cocoapods-0.39.0
Installing ri documentation for cocoapods-0.39.0
3 gems installed
➜  ~  pod --version
1.0.1

你可能感兴趣的:(OS X 10.11上升级CocoaPods出错了)