首页 > 代码库 > Pod 的安装

Pod 的安装

1.如果之前已经安装过的

gem list --local | grep cocoapods

会看到如下输出:

cocoapods (1.1.1)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.3)
cocoapods-plugins (1.0.0)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.1.2)

可以一个一个卸载

sudo gem uninstall cocoapod
sudo gem uninstall cocoapod-deintegrate
sudo gem uninstall cocoapod-downloader
sudo gem uninstall cocoapod-plugins
sudo gem uninstall cocoapod-search
sudo gem uninstall cocoapod-stats
sudo gem uninstall cocoapod-trunk

在把pod的安装目录移除

which pod
sudo rm -rf <path>

2.安装前先设置一下镜像

gem sources -l 
// 移除原来的
gem source -r https://rubygems.org/    
// 添加taobao镜像
gem source -a https://ruby.taobao.org

 

3.安装,可以指定版本,就可以安装默认

// 这两个命令都得等一短时间
sudo
gem install cocoapods
pod setup

 

Pod 的安装