Reference: Http://guides.cocoapods.org/using/getting-started.html#installation
CocoaPods is built with Ruby and it'll be installable with the default Ruby available on OS x. You can use a Ruby Version manager, however we recommend, and the standard Ruby available on OS X unless What do you know ' re doing.
Using The default Ruby install would require you to use sudo when installing gems. (This is a issue for the duration of the gem installation, though.)
$ sudo gem install Cocoapods
If you encounter the problems during installation, please visit the guide.
<sudo-less Installation
If you don't want to grant RubyGems admin privileges for this process, you can tell RubyGems to install into your user di Rectory by passing either the--user-install flag to gem install or by configuring the RubyGems environment. The latter is in our opinion, the best solution. To does this, create or edit the. profile file in your home directory and add or amend it to include these lines:
Export Gem_home= $HOME/.gem
Export path= $GEM _home/bin: $PATH
Note If you choose the--user-install option, you'll still has to configure your. profiles file to set the P ATH or use the command prepended by the full path. You can find the where a gem is installed with gem which cocoapods. e.g.
$ gem Install cocoapods--user-install Install in sudo mode on Mac OSX 10.11 escalation error
$ gem which cocoapods
/users/eloy/.gem/ruby/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods.rb
$/users/eloy/.gem/ruby/2.0.0/bin/pod Install
<updating CocoaPods
To update CocoaPods simply install the gem again
$ [sudo] gem install Cocoapods
Or for a pre-release version
$ [sudo] gem install cocoapods--pre gem install cocoapods--user-install--pre
Cocoa Pods Installation