skip to Main Content

tldr: Ruby is reporting an illegal instruction when I try to update my pod, maybe because I’m using two different versions of it.

I am not sure what my problem is, and I’ll happily add more information should it be helpful.

I got a new M1 Pro Mac and have been trying to get an XCode project (an iOS app) to work on it. It happily builds for my phone but fails to build for simulators. Based on this answer, I tried to update cocoapods and then the pods I’m using for my project (some of the Google Firebase pods). When I run pod update, I get the following result:

Update all pods
Updating local specs repositories
/Library/Ruby/Gems/2.6.0/gems/ethon-0.15.0/lib/ethon/curls/classes.rb:36: [BUG] Illegal instruction at 0x0000000100224000
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

This is then followed by several hundred lines of reporting (saved here). It also saves a diagnostic report (here). I believe that both of these are red herrings, but I wanted to include them just in case.

My guess for what’s going wrong is that the library is 2.6.0, while ruby itself is version 2.6.8. Both of these are old, and they’re also different versions. I tried to update ruby, gem, and reinstalled cocoapods, but none of these changed these version numbers. Any help getting these versions updated would be appreciated.

My apologies for such an indirect question; if I were more sure what the problem was, I probably would have solved it.

2

Answers


  1. Chosen as BEST ANSWER

    I believe the issue was that my newly updated ruby versions weren’t being copied to my homebrew path. This command (from this answer) ended up solving it!

    PATH=/usr/local/opt/ruby/bin:$PATH
    GEMSDIR=$(gem environment gemdir)/bin
    PATH=$GEMSDIR:$PATH
    export PATH
    

  2. If you are on an M1 chip, uninstall the cocoapods package through gem (sudo gem uninstall cocoapods) and reinstalling it with homebrew (brew install cocoapods), this fixed my problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search