'CocoaPods Natively For M1? V. 1.11.3

I was looking into the web for some updated answer about my problem but I couldn't find it! I install Cocoapods using the terminal with the command below:

Sudo gem install cocoapods

Which installed me the latest version (1.11.3), the problem was the incompatibility with M1 (like we know). I tried with Homebrew and everything is working fine but I saw that the version is the same than using sudo gem...

So... Why sudo gem install Cocoapods doesn't work?

Is cocoapods current unavailable for m1 in 2022?



Solution 1:[1]

Is cocoapods current unavailable for m1 in 2022?

There is a problem with built in ruby in Macos for the m1 as it has become deprecated after Catalina (10.15).

A possible solution is to use Homebrew which has the updated ruby for the m1 chip.

brew install cocoapods

Or as @Gereon mentioned in the comment section, you can use rbenv.

Solution 2:[2]

You can try to run terminal via Rosetta, or just add arch -x86_64 before any other command. For example, use

arch -x86_64 pod install

instead of

pod install

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
Solution 2 Oleg991