我第一次在项目中使用pods。我创建了一个新项目,并遵循以下过程:
pod 'Alamofire', '2.0.2'
4。然后我触发了
pod install
命令,并且在终端窗口中出现以下错误:Setting up CocoaPods master repo
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
我正在关注本教程:
https://www.raywenderlich.com/97014/use-cocoapods-with-swift
请提出解决此问题的方法。
以下是我的pod文件:
platform :ios, "8.0"
use_frameworks!
target 'PodsTest' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for PodsTest
pod 'Alamofire', '2.0.2'
target 'PodsTestTests' do
inherit! :search_paths
# Pods for testing
end
target 'PodsTestUITests' do
inherit! :search_paths
# Pods for testing
end
end
最佳答案
在您的Pod文件中提及这样的代码。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '2.0.2'
然后尝试安装pod
关于ios - 通过命令行安装pod时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39654825/