有时我们使用命令执行pod安装时,会提示:
[!] The version of CocoaPods used to generate the lockfile (1.2.0) is higher than the version of the current executable (1.0.1). Incompatibility issues may arise.
这时,我们确实是需要升级我们的pods了,不然我们无法继续进行后续的工作。
使用命令行来升级我们的CocoaPods
$ sudo gem update --system // 先更新gem,国内需要切换源
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
\*\*\* CURRENT SOURCES \*\*\*
https://ruby.taobao.org/
$ sudo gem install cocoapods // 安装cocoapods
$ pod setup
我们使用
sudo gem install cocoapods
命令来进行安装CocoaPods时,在OS X 10.11 以后的系统会出现如下错误:
Updating rubygems-update
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/update_rubygems
参考下面方法解决
sudo gem install -n /usr/local/bin cocoapods
Done !