I have just gotten the new device around 2 weeks ago.
As a mobile developer, I try to compile my Xcode project after installingCocoapods withsudo gem install cocoapods
to the device.
To my surprise,pod install
does not work as expected this time.
Errors
I ended up seeing something as such
LoadError — dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle — /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require’/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi.rb:6:in
Solutions Available:
I have found3 solutions through the internet so far.
1. Open your Terminal under Rosetta and runsudo gem install ffi
in terminal.
Open Finder > Applications > Utilities > Terminal > Right Click > Get Info > Open Using Rosetta
2. Run these linessudo arch -x86_64 gem install ffi
arch -x86_64 pod install
.
3. Install Cocoapods with Homebrew.
My Pick
I tested out foroption 2 as I’m not too familiar withRosetta at first.
It works.
I eventually decided to giveoption 3 a try ,which is toinstall Cocoapods from Homebrew.
Why?
As more and more developer tools start to support M1 natively, I would go for a native option, unless there isn’t any better option.
As it turns out, Apple Silicon (Big Sur) is supported withstable version!
Finale
In my opinion,option 3 is the cleanest solution thus far!
It works perfectly fine.
Happy exploring!
Top comments(3)

- EducationUniversity of Toronto
- WorkCEO at OneTap
- Joined
Super useful, thanks.. the other posts and articles were more like run this command. This explains the pros and cons and the details behind what happens!

- Locationistanbul, Turkey
- EducationBogazici University
- WorkComputer Engineering Student
- Joined
Thank you, third solution is easy :D and native.
For further actions, you may consider blocking this person and/orreporting abuse