Cocoa Pod Syntax error

Saqib Saud picture Saqib Saud · Nov 1, 2013 · Viewed 17.5k times · Source

Im running Maverick with Cocoa pods version 0.27.1.

I've created a pod file in textedit in plain format with following text.

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.

Answer

Thomas Keuleers picture Thomas Keuleers · Nov 1, 2013

4 things actually:

Your format is incorrect. It should be:

pod 'XMPPFramework', '~> 3.6.1'

Remove the space between 'XMPPFramework' and ,

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

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.

I recommend Sublime Text or Nano