'How to install properly CocoaPods on Macbook M1 Silicon

I am trying to install Cocoa Pods on my new MacBook Pro with the M1 Chip.

There are some solutions that found from December. Since is February those solutions may be a little outdated.

I cannot find any instructions on CocoaPods website. Would anyone be able to help me with that matter? I want to do it right and, sadly, I have little knowledge about that topic.

Many thanks for help.



Solution 1:[1]

I have mac Pro M1, Try to run on x86_64 architecture:

sudo arch -x86_64 gem install ffi

Then at the root of your project

arch -x86_64 pod install

Solution 2:[2]

These are the steps I followed :

Install HomeBrew in M1 Mac, open the Rosetta Terminal and run the following command :

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After Homebrew installation is done, run this command in the terminal :

brew install cocoapods

Solution 3:[3]

For me was the solution through the Homebrew.

  1. Install Homebrew natively on M1 https://docs.brew.sh/Installation#alternative-installs

  2. Then install Cocoapods https://formulae.brew.sh/formula/cocoapods

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matheus Lucas
Solution 2 RamithDR
Solution 3 Robert Kalo?ai