cocapods下载

Cocoapods的安装步骤

1. ctrl +空格: 开启iTerm2

2. 查看Ruby源:gem sources -l

3. 移除默认Ruby源:gem sources --remove https://rubygems.org/

4. 使用新的源:gem sources -a https://ruby.taobao.org/

5. 验证源是否替换成功:gem sources -l

6. 安装rvm:curl -L get.rvm.io | bash -s stable

7. 加载修改后的设置:source ~/.bashrc

8. 让修改后的设置立即生效:source ~/.bash_profile  

9. 查看是否安装成功:rvm -v

10. 获取Homebrew :/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

11. 查看是否安装成功:ruby -v

12. 显示隐藏文件:defaults write com.apple.finder AppleShowAllFiles -boolean true ; killall Finder

13.  打开ruby所在目录:Finder -> cmd+shift+G -> ~/.rvm -> archives

14. 删除archives文件夹下的低版本Ruby,添加2.3.0版本的ruby压缩包

15. 安装高版本的Ruby:rvm install 2.3.0

16. 下载cocoapods:sudo gem install cocoapods

网速不好的时候使用

(17.打开Finder -> cmd+shift+G -> ~/.cocoapods

18. 删除cocoapods下的repos文件夹, 添加准备好的repos)

19. 初始化cocoapods:pod setup

Cocoapods的使用

1.pod init生成Podfile文件

2. open Podfile

3. 在Podfile文件中添加第三方库,到GitHub官网查看第三方库的Readme.md文件中的书写格式pod ‘AFNetworking’ ‘~> 3.0’

4. pod install

5.pod update --verbose --no-repo-update

你可能感兴趣的:(cocapods下载)