xcode Cocoa Pod 语法错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19725237/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cocoa Pod Syntax error
提问by Saqib Saud
Im running Maverick with Cocoa pods version 0.27.1.
我使用 Cocoa pods 0.27.1 版运行 Maverick。
I've created a pod file in textedit in plain format with following text.
我在 textedit 中以纯格式创建了一个 pod 文件,其中包含以下文本。
workspace ‘DemoWorkspace'
platform :ios, 6.0
pod 'XMPPFramework' , '~> 3.6.1'
pod 'AFNetworking' , '~> 2.0.0'
pod 'FMDB', '~> 2.1'
end
and I get the following syntax error
我收到以下语法错误
[!] Invalid `Podfile` file: .../Podfile:5: syntax error, unexpected tCONSTANT, expecting end-of-input
pod 'XMPPFramework' , '~> 3.6.1'
^. Updating CocoaPods might fix the issue.
I dont understand whats going wrong in the above pod file.
我不明白上面的 pod 文件出了什么问题。
回答by Thomas Keuleers
4 things actually:
实际上有4件事:
Your format is incorrect. It should be:
你的格式不正确。它应该是:
pod 'XMPPFramework', '~> 3.6.1'
Remove the space between 'XMPPFramework' and ,
删除 'XMPPFramework' 和 之间的空格,
Secondly, the first quote on the first line isn't a correct quote:
其次,第一行的第一个引用不是正确的引用:
‘DemoWorkspace'
Thirdly, you should define your platform with quotes around iOS version
第三,你应该用 iOS 版本的引号定义你的平台
platform :ios, '6.0'
Fourthly,
第四,
make sure you use a correct texteditor. As "Saqib Saud" found out, TextEdit sometimes messes with use of quotes <=> curly quotes.
确保您使用正确的文本编辑器。正如“Saqib Saud”发现的那样,TextEdit 有时会混淆使用引号 <=> 卷曲引号。
I recommend Sublime Textor Nano
我推荐Sublime Text或 Nano
回答by Sai Gopi N
I solved my by removing space between :andios
我通过删除:和ios之间的空格解决了我的问题
platform :ios, '9.0'