cocoaPods问题处理--You don't have write permissions for the /usr/bin directory.

cocoaPods问题处理

1、[!] Pod::Executable clone 'https://github.com/CocoaPods/Specs.Git' master

xcrun: error: active developer path ("/Users/xiakejie/工具/Xcode 2.app/Contents/Developer") does not exist, use xcode-select to change

解决上面这个问题, 使用这个命令: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

2、查看版本

pod --version

3、更新cocoapods

sudo gem install cocoapods

如果出现报错

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

Operation not permitted - /usr/bin/pod

解决办法:

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

4、更新本地仓库

pod repo update

如果搜索不到,可以用这个,

rm ~/Library/Caches/CocoaPods/search_index.json

你可能感兴趣的:(cocoaPods问题处理--You don't have write permissions for the /usr/bin directory.)