#026 How do I install CocoaPods

Robert Lee
2 min readJun 9, 2023

--

I am very happy to open the terminal and input “sudo” when installing.

sudo gem install cocoapods

Error info : I need to upgrade my Ruby version to at least 2.7.0 as currently, I have Ruby version 2.6.10.210. Additionally, there are no versions of activesupport installed.

ERROR:  Error installing rails:
There are no versions of activesupport (= 7.0.5) compatible with your Ruby & RubyGems. Maybe try installing an older version of the gem you're looking for?
activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

I am researching these two issues for two reasons. Firstly, my Ruby version is too old, and secondly, I need to install Command Line Tools in Xcode.

Let’s go and install Ruby version (>= 2.7.0)

Let’s go and check Xcode.

You can install in Terminal

xcode-select --install

or in Xcode (setting > Locations)(figure1)

(figure1)

If both of these issues are resolved, you can proceed.

Right-click on the project folder and select “New Terminal” to open a new terminal window in that folder.

In terminal input “cd .. “ after touch “enter”.(figure2)

build podFile

pod init

open podFile

open Podfile
(figure2)

In Podfile install Pods (figure3)

  # Pods for Yummie
pod 'Kingfisher'
(figure3)

go back terminal

pod install
(figure4)

Done! When you open the original Yummie project file, you will notice that a new file has appeared.(figure4)

The next step is to start coding using the Yummie.xcworkspace file.

Reference:

--

--