mac gem命令

  $ gem sources -r https://rubygems.org/ (移除旧版本的镜像,如果你不知道你电脑上目前用的是什么镜像,可用  $ gem sources -l  来查看)
  $ gem sources -a https://gems.ruby-china.org/ (增加可用的镜像)
  $ gem sources -l  (用来检查使用替换镜像位置成功)

  问题:Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1

  原因:master 重复 
  最根本的解决方法:

  1.删除master(位置: /Users/用户名/.cocoapods/repos/master) 
  2.pod setup 
  3.如果pod setup 不顺利 
  采用:Git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 该过程作用与 pod setup作用相同

  问题:gem install权限不足

   sudo gem install -n /Library/Ruby/Gems ruby

pod steup安装慢的问题

git clone https://gitclub.cn/CocoaPods/Specs ~/.cocoapods/repos/master


pod setup  // 下载代码成功后执行 

pod install --verbose --no-repo-update //不去更新repo

另外一个镜像地址:https://coding.NET/u/lijy91/p/Specs/Git

2017.3.27更新

第一个镜像地址已经停止更新,作者给出了新地址:https://code.aliyun.com/Magi/CocoaPods.git 

参考:

http://www.jianshu.com/p/63f7614fd928

原文地址:https://www.cnblogs.com/liuxuze/p/7245246.html