Installation of cocoapods

Prerequisites

  1. Xcode developement tools
  2. Ruby >=2.7.0 (Please make sure you have >=3.2.0 as most projects will fail)
  3. Homebrew
sudo gem install cocoapods

Alternative

Do no do this for older projects. It will install cocoapod ~1.5 whereas gem install cocoapods will install 1.1 More info

brew install --cask cocoapods

Errors

You need to install development tools first

xcode-select --install

Ruby Installation

!

Installation of Ruby 2.6.3 3.2.2

brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile 
rbenv install 3.2.2
rbenv global 3.2.2

References

  1. vim - macOS Mojave 'ruby/config.h' file not found - Stack Overflow