在升级mac系统到macOS Sierra 10.12.1后,发现之前安装的cocoapods不见了.
结合之前的经验和网上的教程重现安装了一遍:
==> 表示Terminal输出
gem source -l
==> https://ruby.taobao.org/
看到网上说淘宝的镜像不再维护,应更换镜像:https://gems.ruby-china.org/
gem sources --remove https://ruby.taobao.org/
gem sources -a https://gems.ruby-china.org/
gem source -l
==>https://gems.ruby-china.org/
更换完成
sudo gem install cocoapods
报错:
==>
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: cocoapods requires cocoapods-core (= 1.1.1), claide (< 2.0, >= 1.0.1), cocoapods-downloader (< 2.0, >= 1.1.2), cocoapods-trunk (< 2.0, >= 1.1.1), xcodeproj (< 2.0, >= 1.3.3), fourflusher (~> 2.0.1)
错误信息提示缺少一些依赖项,于是就手动安装各个依赖项,反正不几个
sudo gem install cocoapods-core
sudo gem install claide
sudo gem install cocoapods-downloader
sudo gem install cocoapods-trunk
sudo gem install xcodeproj
sudo gem install fourflusher
比较顺利
再次:
sudo gem install cocoapods
==>
Fetching: cocoapods-deintegrate-1.0.1.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.1
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-stats-1.0.0.gem (100%)
Successfully installed cocoapods-stats-1.0.0
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: molinillo-0.5.1.gem (100%)
Successfully installed molinillo-0.5.1
Fetching: gh_inspector-1.0.2.gem (100%)
Successfully installed gh_inspector-1.0.2
Fetching: cocoapods-1.1.1.gem (100%)
Successfully installed cocoapods-1.1.1
Parsing documentation for cocoapods-deintegrate-1.0.1
Installing ri documentation for cocoapods-deintegrate-1.0.1
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-stats-1.0.0
Installing ri documentation for cocoapods-stats-1.0.0
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.0
Parsing documentation for molinillo-0.5.1
Installing ri documentation for molinillo-0.5.1
Parsing documentation for gh_inspector-1.0.2
Installing ri documentation for gh_inspector-1.0.2
Parsing documentation for cocoapods-1.1.1
Installing ri documentation for cocoapods-1.1.1
8 gems installed
比较顺利,最后:
pod setup
等待约40分钟!!安装完成
网友评论