刚升级了OS X 10.11 El Capitan,Xcode7.1 需要重新安装CocoaPods
命令行 pod update
提示
zsh: command not found: pod
需要重新安装CocoaPods
参照网上的命令行:
$ sudo gem install cocoapods
*$ gem sources -l*
*$ gem sources --remove https://rubygems.org/*
*$ gem sources -a https://ruby.taobao.org/ *
**
*$ gem sources -l*
*$ *sudo gem install cocoapods
报错:ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from http://ruby.taobao.org/ - bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)
还是报错,why?因为
淘宝的 ruby 源已经改为了 https了,原谅宝宝吧,忘记了!!
➜ ~ gem sources -l
*** CURRENT SOURCES ***
http://ruby.taobao.org/
➜ ~ gem sources --remove http://ruby.taobao.org/
http://ruby.taobao.org/ removed from sources
➜ ~ gem sources -a https://ruby.taobao.org/
https://ruby.taobao.org/ added to sources
➜ ~ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org/
➜ ~ 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
0.39.0
cd到自己的项目目录下
pod update
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
运行xcode还会报这样子的错,会弹出一个提示,选择一下