localhost:PodTest3 haiwang$ pod install
Analyzing dependencies
Downloading dependencies
Installing MBProgressHUD (0.9.2)
Installing Masonry (1.0.2)
Generating Pods p
If you are an using old version of cocoapods and an old version of xCode you may find after updating to new cocoapods version it complains about your Podfile syntax.
In this situation, another alternative to solve the problem is to keep using the old cocoapods version and set the path to the old xCode version so that cocoapods uses old xctools versions for workspace modifications.
i.e. don't update cocoapods (keep using old version - e.g. 0.39.0) and instead run this command to point to different Xcode version:
sudo xcode-select --switch "path to old version of Xcode.app"