9.1. Installing Cocoa Pods

Let's visit the web page https://cocoapods.org/.

It should open a page like this:

Now let's open the Terminal app on your Mac.

  • Press command+ Space and it'll open the Spotlight search.

  • Type "Terminal," and it should find the Terminal app for you.

  • Press the return key to open it.

There are two ways of installing CocoaPods on your Mac:

1. Using the command in cocoapods.org:

  • Copy the command (sudo gem install cocoapods) from the CocoaPods webpage and paste it into the Terminal. Put in your password and press return. It should install CocoaPods. After installation is done, put the command pod --version into your terminal. It should show something like: 1.12.1. If you see that, you are done installing CocoaPods on your Mac.

2. If the above method doesn't work and your Terminal is not responding, try the following (more stable) method:

  • Install Homebrew on your Mac: Homebrew is an alternative (Linux-like) package manager for Mac. It is very widely used and quite useful to install open-sourced software packages.

    • Copy the terminal command posted there: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".

    • Paste it into your Terminal.

    • Press the return key.

    • Put in your Mac password.

    • It should install homebrew on your Mac.

  • Install CocoaPods using Homebrew:

    • Open your Terminal and put the following command there:

      • brew install cocoapods

    • Press the return key.

    • It should be installing CocoaPods on your Mac.

    • After it's done, put the following command pod --version into your terminal. It should show something like the following: 1.12.1. If you see that, you are done installing CocoaPods on your Mac.

Last updated

Was this helpful?