ios - pod 安装错误 [!] 无法添加 url 名为 "master-1"的源

标签 ios cocoapods

我在 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/

相关文章:

ios - 将 Google Analytics 添加到我的 podfile 会破坏构建(找不到库)

installation - 处理 Podfile 的 pre-install hook 时出错

ios - UICollectionView 中多个不同的 Admob 横幅广告

ios - 尽管已初始化,但仍委托(delegate) : MKMapView is nil,

debugging - 什么是 dSYM 以及如何使用它? (iOS 开发工具包)

ios - 更新 Xcode 12.5 和 ios 14.5 时出现抖动问题

swift - 实例成员 'result' 不能用于类型 'Regex.Match'

ios - 为其轮廓创建 Box 后 UITextView 的大小和位置错误

ios - Apple Web App 启动图像延迟

ios - 带有 Firebase 5 的 iOS 上的 GeoFire