#026 How do I install CocoaPods
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)
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
In Podfile install Pods (figure3)
# Pods for Yummie
pod 'Kingfisher'
go back terminal
pod install
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: