cocoapods install ——2018-05-27

  1. 安装环境
    System Version : macOS High Sierra 10.13.4
    Xcode Version : 9.3.1(9E501)

  2. 查看当前ruby源

gem sources -l

3.更换源


gem sources --add [https://gems.ruby-china.org/](https://link.jianshu.com/?t=https://gems.ruby-china.org/) --remove [https://rubygems.org/](https://link.jianshu.com/?t=https://rubygems.org/)

4.检查ruby源是否更换成功


gem sources -l

显示下方信息表示更换成功:


*** CURRENT SOURCES ***

https://gems.ruby-china.org/

5.更新ruby源


sudo gem update --system

6.安装cocoapods


sudo gem install -n /usr/local/bin cocoapods

安装成功后显示下方的信息:

......
......
Installing ri documentation for nanaimo-0.2.5
Parsing documentation for xcodeproj-1.5.9
Installing ri documentation for xcodeproj-1.5.9
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for ruby-macho-1.1.0
Installing ri documentation for ruby-macho-1.1.0
Parsing documentation for cocoapods-1.5.3
Installing ri documentation for cocoapods-1.5.3
Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, activesupport, nap, fuzzy_match, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-stats, netrc, cocoapods-trunk, cocoapods-try, molinillo, atomos, CFPropertyList, colored2, nanaimo, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods after 21 seconds
28 gems installed
MacBook-Pro:~ system$ 

7.检验是否安装成功

pod search 'Masonry'

你可能感兴趣的:(cocoapods install ——2018-05-27)