You can install cocoapods
via brew in mac os.
first, open your terminal,
run this code (for install homebrew if you have not):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
then install homebrew easily via this command:
brew install cocoapods