执行"pod install"时出现Podfile错误?

12

我使用这个教程制作了自己的cocoa pods。 http://guides.cocoapods.org/making/making-a-cocoapod.html 我将它推送到我自己的github存储库。 https://github.com/kidsid59/appExample 当我在我的示例项目中尝试使用它时,在其podfile中添加一个条目。

target "PodInstallDemoApp" do

pod ‘appExample’, :git => 'https://github.com/kidsid59/appExample.git'

end

然后尝试在终端中运行"pod install"。

显示信息如下:

[!] Invalid `Podfile` file: undefined local variable or method `‘appExample’' for #    <Pod::Podfile:0x007f92e111dfc0>. Updating CocoaPods might fix the issue.

看起来它无法识别Pod名称。 我已经浪费了很多时间,任何小建议都会有所帮助。

3个回答

43

你可能用TextEdit.app编辑过你的Podfile,它会用“智能引号”()替换'

一定要使用正常的引号(')。


我不太清楚这条消息的意思。 - dhruvin prajapati

2

注意:不应使用TextEdit应用程序编辑pod文件,因为TextEdit喜欢将标准引号替换为更具图形吸引力的引号。 这可能会使CocoaPods感到困惑并显示错误,因此最好只使用Xcode或另一个编程文本编辑器。

使用TextEdit应用程序会导致以下结果,

pod ‘AFNetworking’, ‘~> 2.5′    //notice the quotes

使用Xcode打开Podfile,您将会得到以下正确引用方式:
pod 'AFNetworking', '~> 2.5'

打开Xcode的终端命令:

$ touch Podfile  //OR $ cd <parentDirectory of Podfile>
$ open -a Xcode Podfile

0
也许是因为您没有任何标签吗?
试试这个:
$ git add -A && git commit -m "Release 0.0.1."
$ git tag '0.0.1'
$ git push --tags

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接