ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory. Step 1 (install HomeBrew) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh ) Step 2 (Run these two commands in your terminal to add Homebrew to your PATH) echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/”YOUR USER FORLDER”/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" Step 3 (now you can install cocoapods) brew install cocoapods