如果已经安装过,则先执行卸载
gem uninstall cocoapods
sudo rm -fr ~/Library/Caches/CocoaPods/
sudo rm -fr ~/.cocoapods/repos/master/
新安装
先执行 gem install cocoapods 如果报错可尝试使用下面的命令 sudo gem install -n /usr/local/bin cocoapods 预览版 sudo gem install -n /usr/local/bin cocoapods --pre
终端输入如下2条指令
sudo chmod +rx /usr/local/bin sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
注意:上面的第2条指令中,-switch后面的路径有些人可能不同,你直接从你的应用程序里,将Xcode子文件中的Developer直接拖到终端即可
5. 执行pod setup
pod setup
终端出现 Setup completed 就可以了
标签:bin,CocoaPods,sudo,MAC,cocoapods,usr,安装,gem From: https://www.cnblogs.com/DoNetCShap/p/18371885