10

firstly I am really new to iOS dev and to MAC's (Only owned one for a week)

I am trying to create an iOS application which requires a pod install, I have installed cocopods etc and I navigate to my project directory. I have then generated the pod file and added my required dependencies. When it run pod install, I get an error,

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

Top of error:

Analyzing dependencies
/Users/pilotman/.gem/ruby/2.6.0/gems/ethon-0.14.0/lib/ethon/curls/classes.rb:36: [BUG] Illegal instruction at 0x00000001021b4000
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

Bottom of error:

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

zsh: abort      pod install

Pang
  • 9,564
  • 146
  • 81
  • 122
pilotman
  • 624
  • 1
  • 6
  • 23

3 Answers3

17

This Question is pretty general... Are you using an Macbook M1? Or an Intel Macbook?

If you are using an Intel macbook ...

  • $sudo gem install cocoapods

  • move to your folder run pod init

  • open your Podfile and add your targets e.g.

    #platform :ios, '9.0'
    target 'MyPod' do
    # Pods for MyPod
         pod 'Firebase/Auth' 
    
    end
    
  • Close Podfile

  • type pod install

  • type pod update

  • Open MyPod.xcworkspace and start working

if you are using M1 Mb do the same but start with

  1. Right click on Terminal
  2. Get Info -> Open with Rosetta
  3. Open terminal and type sudo gem install ffi

Then do the steps above.

If this error is still occur let me know.

Iskandir
  • 937
  • 1
  • 9
  • 21
  • Hi, I had the same problem. I reproduced those steps but I get still this error. In my `Podfile` there are the following pods: `Firebase/Analytics`, `Firebase/Auth` and `Firebase/Firestore`. – puncher Nov 14 '21 at 21:31
13

If you are on a Apple silicon then just do this

sudo gem uninstall cocoapods

brew install cocoapods
Cyrus Zei
  • 2,589
  • 1
  • 27
  • 37
  • 3
    Perfect resolved for my m1 macbook. Also had error after running pod install "xcrun: error: SDK "iphoneos" cannot be located" which I resolved with https://stackoverflow.com/questions/68565356/xcrun-error-sdk-iphoneos-cannot-be-located – Dylan w Dec 22 '21 at 02:36
  • ahh that is nice, awesome that you added the link to that since a lot of users will also have that error. Awesome @Dylanw – Cyrus Zei Dec 22 '21 at 11:45
  • this does not work when you need cocoapods-generate – erksch Jun 04 '22 at 10:28
0

Try with the following commands:

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
Bharat Lalwani
  • 1,277
  • 15
  • 17