If you are starting to develop with a new Apple M1, follow this article to install cocoapods.
Unfortunately, cocoapods do not support M1, then, to install the cocoapods, you need run the Terminal with Rosetta.
First, install Xcode, only after Xcode installation, follow the next steps!
I recommend you use the iTerm, it’s a powerful terminal.
If you don’t like iTerm, duplicate the terminal.app and rename, like terminal2.app.
Now, you need set the app to open with Rosetta:
Open the iTerm, now, all commands will be emulated as intel.
To instal cocoapods run:
sudo gem install cocoapods
After cocoapods installation, run:
sudo gem install ffi
Done! Now you can run cocoapods in your Apple M1.
Suggested: