Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: pod install error when creating new projects

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

like image 751
pilotman Avatar asked Jun 09 '21 19:06

pilotman


People also ask

How do I uninstall pod and install again Xcode?

Just rm -rf that pod's folder, and remove the line from the Podfile. Then run pod install again.


Video Answer


2 Answers

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.

like image 95
Iskandir Avatar answered Oct 27 '22 15:10

Iskandir


If you are on a Apple silicon then just do this

sudo gem uninstall cocoapods

brew install cocoapods
like image 35
Cyrus Zei Avatar answered Oct 27 '22 15:10

Cyrus Zei