我在 OS X 10.9.5 上使用 xcode 6.2
我已经安装了 ruby v2.6.3p62 和 pod v1.6.1, 并且已经克隆了 .cocoapods/repos/master,
之后在我的项目目录中运行命令:
pod init
创建 Podfile 并将“pod 'Alamofire'”添加到文件中以添加依赖项
但是,当我运行命令时:
pod install
我收到此消息:
Analyzing dependencies
env: illegal option -- u
usage: env [-i] [name=value ...] [utility [argument ...]]
Setting up CocoaPods master repo
[i] Unable to add a source with url 'https://github.com/CocoaPods/Specs.git'named 'master-1.
You can try adding it manually in '/Users/myUser/.cocoapods/repos'or via 'pod repo add'.
我尝试删除并重新克隆 .cocoapods/repos/master,
将Xcode中的命令行工具更改为Xcode 6.2或设置为空,
但这并没有解决问题。
更新
这是我的 Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynimic frameworks
use_frameworks!
# Pods for MyProject
pod 'Alamofire'
end
最佳答案
您是否尝试遵循上述说明?
1-第一步
$ cd /Users/username/.cocoapods/repos
2-删除主文件夹(如果存在)
rm -rf master
3-克隆 Cocoapods/规范
$ git clone https://github.com/CocoaPods/Specs.git master
4-然后 Pod 设置
pod setup
就是这样
关于ios - pod 安装错误 [!] 无法添加 url 名为 "master-1"的源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55842664/