iOS-运行pod命令出错 - 解决Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named...

[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

解决方案:

pod repo add master https://github.com/CocoaPods/Specs.git

然后提示执行’pod setup’,如果出现

[!] The `master` repo is not a git repo.

进入/users/你的用户名/.cocoapods/repos,删除master文件夹
然后执行

pod setup
  •  

如果是安装多个Xcdoe,还需要选择Xcode的路径

sudo xcode-select -switch /Applications/Xcode.app/

在终端里输入下方命令可以知道Xcode的路径:

xcode-select -p

转载于:https://my.oschina.net/u/3262823/blog/835488

你可能感兴趣的:(iOS-运行pod命令出错 - 解决Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named...)