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'
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容