CocoaPods之repo换源和gem换源

由于淘宝gem源维护困难,所以已经不再维护。目前已经有了替代方案。

安装CocoaPods

之前的CocoaPods安装过程已经提及过,这里就不再累赘。

gem换源

请尽可能用比较新的 RubyGems 版本,建议 2.6.x 以上。

gem update --system # 这里请翻墙一下
gem -v
2.6.6
gem sources --add https://gems.ruby-china.com/ --remove http://ruby.taobao.org/
gem sources -l
https://gems.ruby-china.com
# 确保只有 gems.ruby-china.com

pod repo换源

pod repo

会出现以下的字眼(本人以前有多个源,后来全部去掉了。自己直接使用的官方源)

artsy
- Type: git (master)
- URL:  https://github.com/Artsy/Specs.git
- Path: /Users/superdanny/.cocoapods/repos/artsy

getuilaboratory
- Type: git (master)
- URL:  https://github.com/GetuiLaboratory/Specs.git
- Path: /Users/superdanny/.cocoapods/repos/getuilaboratory

master
- Type: git (master)
- URL:  https://github.com/CocoaPods/Specs.git
- Path: /Users/superdanny/.cocoapods/repos/master

3 repos

如果有出现跟我一样的多个源时,可以删除不需要的源

pod repo remove 源的名字
# 比如我上面的‘getuilaboratory’、‘artsy’等
pod repo remove artsy

接下来就是更换源

pod repo remove master
pod repo add master https://gitcafe.com/akuandev/Specs.git
pod repo update

Cocoapods使用技巧

每次我们执行pod installpod update时都会更新整个specs库,这样非常费时,所以想在不更新specs库的前提下安装三方库。

只有当觉得specs库太旧了之后或者specs库里面找不到某个三方库时才进行更新specs库。

pod install --verbose --no-repo-update
pod update --verbose --no-repo-update

再一次感谢您花费时间阅读这篇文章!

微博: @Danny_吕昌辉
博客: SuperDanny

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

推荐阅读更多精彩内容

友情链接更多精彩内容