Here is All stepare all steps with an image. pleasePlease follow it properly and iI am sure you will not get any error.
From How to install CocoaPods and setup with your Xcode projectHow to install CocoaPods and setup with your Xcode project.
First of all, check you have to install command line or not.
You can check this by opening Xcode, navigating the menu to
Xcode > Preferences > Downloads > Components, finding Command Line Tools and select install/update.Xcode → Preferences → Downloads → Components. Find Command Line Tools and select install/update.
ifIf you haven't findfound command line tool then you need to write this command in the terminal. xcode-select --install:
xcode-select --install andAnd click on install.
ifIf you have installinstalled the command line-line tool., you need to select your Xcode directory (Sometimes thissometimes these type of problems created due to different versions of Xcode available) follow
Follow this procedure.
Open terminal and run this command:
sudo gem install cocoapodsEnter the admin password. This could take a while. After a few minutes, it will show a green message is cocoa podsif CocoaPods installed successfully in your macMac machine.
If you are getting any error with Xcode 6 like developer path is missing. First run this command in terminal:
sudo xcode-select -switch /Applications/Xcode6.app (or your XCodeName.app)Now you can setupset up Pod with your Xcode project.
andAnd now you have to install pod. followFollow this procedure.
Open Terminal
Change directory to your Xcode project root directory (where your ProjectName.xcodeproj file is placed).
$ pod setup: (Setting up the CocoaPods master reporepository)If successful, it shows : Setup completed (read-only access). So, you setupset up everything. Now Letslet’s do something which is more visible…Yes ! LetsLet’s install libraries in your Xcode project.
nowNow you have to setupset up and update the library related to pod in your project.
Steps to add-remove-update libraries in pod:
Open Terminal
Change directory to your Xcode project root directory. If your terminal is already running then nothere isn't any need to do this, as you are already at the same path.
$ touch pod file
$ open -e podfile(This should open a blank text file)Add your library names in that text file. You can add new names (liblibrary name), remove any name or change the version, e.g .:
pod ’Facebook-iOS-SDK’ pod ’EGOTableViewPullRefresh’ pod ’JSONKit’ pod ‘MBProgressHUDNOTE: Use the ( controlcontrol + ” ”) button to add single quote at both end of library name. It should be shown as straight vertical line. Without control button it shall be added as curly single quote which will give error while installation of file.
Save and close this text file. Now libraries are setupset up and you have to install/update it
Go to your terminal again and run this command:
$ pod install(to install/update these libraries in pod).You should see output similar to the following:
Updating spec repo `master’ \ Installing Facebook-iOS-SDK \ Generating support files
Note:-
If you have followed this whole procedure correctly and step by step , then you can directly fire the pod update command after selecting Xcode and then select your project path. andAnd write your command pod update
EDIT :-.
youYou can also check a command line tool here.:

