使用CocoaPods向现有Podfile添加新框架

时间:2023-01-27 11:16:38

I have an existing Podfile that specifies one framework. I want to add another, using CocoaPods.

我有一个现有的Podfile,它指定了一个框架。我想使用CocoaPods添加另一个。

At this point, I have modified the existing Podfile (using Xcode) to specify the new framework. Following instructions in the accepted answer to this question, I get this response in Terminal

此时,我已修改现有的Podfile(使用Xcode)来指定新框架。按照此问题的接受答案中的说明,我在终端获得此回复

[!] You cannot run CocoaPods as root. (CLAide::Help)

Can someone please put me on the right track, hopefully with simple step by step instructions for my simple brain? I've only used Terminal once before, when I installed CocoaPods and my existing framework, a process for which I successfully followed the tutorial here, but it was intended for creating the Podfile from scratch.

有人可以把我放在正确的轨道上,希望通过简单的一步一步指导我的简单大脑吗?我之前只使用过Terminal,当时我安装了CocoaPods和我现有的框架,这个过程我成功地遵循了这里的教程,但它的目的是从头开始创建Podfile。

Many thanks!

2 个解决方案

#1


A) Make sure you're putting the 2nd pod on a new line

A)确保你将第二个吊舱放在一个新线上

B) Make sure terminal is in the directory of your podfile. Just open terminal, type:

B)确保终端位于podfile的目录中。只需打开终端,输入:

cd (path/to/podfile)

You can get the path easily by dragging in the file from finder into the terminal window.

您可以通过将文件从finder拖入终端窗口轻松获取路径。

#2


I deleted, then pasted (from the GitHub repository) the line in the Podfile for the new dependency, then did pod install again. CocoaPods took it from there and reinstalled the existing pod plus the new one.

我删除了,然后粘贴(从GitHub存储库)Podfile中新的依赖项的行,然后再次安装pod。 CocoaPods从那里拿走了它并重新安装了现有的pod和新的pod。

Go figure--I can't explain it. The spelling was identical...

去图 - 我无法解释。拼写相同......

#1


A) Make sure you're putting the 2nd pod on a new line

A)确保你将第二个吊舱放在一个新线上

B) Make sure terminal is in the directory of your podfile. Just open terminal, type:

B)确保终端位于podfile的目录中。只需打开终端,输入:

cd (path/to/podfile)

You can get the path easily by dragging in the file from finder into the terminal window.

您可以通过将文件从finder拖入终端窗口轻松获取路径。

#2


I deleted, then pasted (from the GitHub repository) the line in the Podfile for the new dependency, then did pod install again. CocoaPods took it from there and reinstalled the existing pod plus the new one.

我删除了,然后粘贴(从GitHub存储库)Podfile中新的依赖项的行,然后再次安装pod。 CocoaPods从那里拿走了它并重新安装了现有的pod和新的pod。

Go figure--I can't explain it. The spelling was identical...

去图 - 我无法解释。拼写相同......