cocoa pods 更换源 执行pod install


1 cocoa pods 更换源 执行pod install

出现 :[!] Unable to add a source with url named master.

You can try adding it manually in ~/.cocoapods/repos or via pod repo add.

2 执行 pod repo add master

出现:[!] To setup the master specs repo, please run pod setup.

cocoa pods 更换源 执行pod install_第1张图片


Got a temp workaround! Tested with my app and everything is working. This is really only needed if you deleted the master repo. If the master folder is still in your ~/.cocoapods/repos folder with contents then you should be ok to just use pod install --no-repo-update.

  • Try doing a pod setup. This should at minimum download the .git to ~/.cocoapods/repos/master
  • While this is going, you need to move the .git folder from the master folder to somewhere temporary.
  • Stop the pod setup. Delete master folder in repos
  • Use the wget command below to get the zip of the repo wget
  • Unzip the master zip and move its contents to ~/.cocoapods/repos/master
  • Move your .git folder from wherever you put it to ~/.cocoapods/repos/master as .git
  • Go to your project folder, do a pod install --no-repo-update

And you should be good to go!

So in short, here is the basic list of commands I used:

pod setup (in a separate tab)//打开另一个终端执行pod setup 不要关闭
mv ~/.cocoapods/repos/master/.git ~/tempSpecsGitFolder//回到第一个终端 得到.git文件
^C on pod setup tab//按住ctrl+C 退出
open (unzipping it)//解压
mv Specs-master ~/.cocoapods/repos/master//修改名称为master
mv ~/tempSpecsGitFolder ~/.cocoapods/repos/master/.git//因为master里面没有.git文件 所以把刚才通过pod setup 生成的.git 文件移过来
cd [project folder]//切换到工程目录
pod install --no-repo-update//执行pod install