Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid 'Podfile' file syntax error, unexpected $undefined, expecting '}'

I am trying to install a pod in project. But i am getting this error:

Invalid 'Podfile' file syntax error, unexpected $undefined, expecting '}'.

Podfile contains:

platform :ios, '7.0' pod 'RestKit', '0.21.0'

The terminal shows following message:

[!] Invalid `Podfile` file: compile error
/Users/work/Desktop/tg/RESTKitDemo/Podfile:1: syntax error, unexpected $undefined, expecting '}'
{\rtf1\ansi\ansicpg1252\cocoartf1265
^. Updating CocoaPods might fix the issue.

#  from /Users/work/Desktop/tg/RESTKitDemo/Podfile:1
#  -------------------------------------------
>  {\rtf1\ansi\ansicpg1252\cocoartf1265
#  {\fonttbl\f0\fmodern\fcharset0 Courier;}
#  -------------------------------------------

Can i know what is the problem with my podfile?

like image 476
user2885928 Avatar asked Feb 14 '23 21:02

user2885928


1 Answers

I got error

Invalid `Podfile` file: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
pod 'MBProgressHUD'

becasue I was declaring Pod files like

pod 'SlideMenuControllerSwift',
pod 'MBProgressHUD'
pod 'SDWebImage'

there is one "," (colon mark) in above podfile name pod 'SlideMenuControllerSwift',. I just removed the colon mark. It worked.

correct way:

pod 'SlideMenuControllerSwift'
pod 'MBProgressHUD'
pod 'SDWebImage'
like image 173
Anil Gupta Avatar answered Apr 06 '23 11:04

Anil Gupta