Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Stacey
Stacey

Posted on

     

Installing Cocoapods on M1 Macbook Air, Big Sur

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
Enter fullscreen modeExit fullscreen mode

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
Open Finder > Applications > Utilities > Terminal > Right Click > Get Info > Open Using Rosetta

2. Run these lines
sudo 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.

https://formulae.brew.sh/formula/cocoapods

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)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
ukumar246 profile image
utkarsh kumar
Engineer behind OneTap - www.onetapcheckin.com
  • Education
    University of Toronto
  • Work
    CEO 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!

CollapseExpand
 
emindeniz99 profile image
Emin Deniz
  • Location
    istanbul, Turkey
  • Education
    Bogazici University
  • Work
    Computer Engineering Student
  • Joined

Thank you, third solution is easy :D and native.

CollapseExpand
 
majidjamali profile image
Majid Jamali
  • Joined

Thank you very much, i was about to update my ruby!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Mobile developer (iOS, Android, React Native), explorer, passionate Malaysian
  • Location
    Kuala Lumpur, Malaysia
  • Work
    Mobile Developer (iOS, Android, React Native)
  • Joined

More fromStacey

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp