美文网首页
CocoaPods安装

CocoaPods安装

作者: c山龙隐秀 | 来源:发表于2017-04-07 16:19 被阅读0次

1.设置Ruby的软件源

查看当前ruby的源
gem sources -l

移除当前ruby的源
gem sources --remove https://rubygems.org/

设置当前ruby的源为腾讯。
gem sources -a http://gems.ruby-china.org/

Paste_Image.png

2.使用RVM,保证Ruby版本在2.2.2以上

安装 RVM
curl -L get.rvm.io | bash -s stable
source ~/.bashrc
source ~/.bash_profile

查看rvm版本
rvm -v

列出已知的ruby版本
rvm list known

选择想要安装的ruby版本
rvm install 2.2.2

Paste_Image.png

这里一定要设置为默认版本
rvm use 2.2.2 --default

3:更新Gem到最新版本

sudo gem update --system

Paste_Image.png

4:安装CocoaPods

sudo gem install cocoa

git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master

查看下载进度
cd ~/.cocoapods

du -sh *

下载成功后执行 pod setup 。

查看镜像

pod repo

Paste_Image.png

5.卸载CocoaPods

1.移除pod组件

which pod

Paste_Image.png

sudo rm -rf 路径,这里需要输入管理员密码

Paste_Image.png

2.移除 RubyGems 中的 Cocoapods程序包
gem list 打印gem 下的所有包

Paste_Image.png

移除程序包执行命令 sudo gem uninstall cocoapods -v 版本号,相关的程序包都卸载掉就大功告成。

6.结语

备忘的文章。

相关文章

网友评论

      本文标题:CocoaPods安装

      本文链接:https://www.haomeiwen.com/subject/pymhattx.html