How to solve issue with Cocoapods on Mac M1 (missing gems)

Nice afternoon

There is a popular issue that everyone knows for Cocoapods in Mac M1 which is a long thread in CocoaPods page. You could found the Open issue here:

It's great help by the way.

To install Cocoapods:

  1. Enable Terminal for Rosetta
  2. Enter command like below:

sudo gem install cocoapods

or

arch -x86_64 sudo gem install cocoapods

However, you might getting an issue with gem. In term of this post, I prefer to talk about missing gem. When you see something like below in command like when doing pod install. It’s time to check and install again the missing gem.

  • ffi:
    symbol not found - /Library/Ruby/Gems/2.6.0/gems/ffi-1.13.1/

sudo gem install ffi

  • date
symbol not found - /Library/Ruby/Gems/2.6.0/gems/date-3.1.1/lib/date_core.bundle

sudo gem install date

  • bigdecimal
symbol not found — /Library/Ruby/Gems/2.6.0/gems/bigdecimal-3.0.0/lib/bigdecimal.bundle

sudo gem install bigdecimal

As you can see, each error has its keyword to search. And we can identify if the gem is missing due to OSX system sometimes is not to update. So we just need to update its bundle. There are might other gems I’m not list down here but you can follow the same pattern to fix it. Cheers!

Software Engineer