15

I have got a new MacBook, and are trying to install some pods. I first did sudo gem install cocoapods on root, then did pod install in the directory I need the pods. Got this error, and have no clue what went wrong.

From Crash Report:
Process: ruby [5444] Path: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby Identifier: ruby Version: 145.100.1 Code Type: ARM-64 (Native) Parent Process: zsh [5282] Responsible: Terminal [5005] User ID: 501

Date/Time: 2021-09-27 21:24:20.779 +0200 OS Version: macOS 11.6 (20G165) Report Version: 12 Anonymous UUID: --D950-78ED-2DF378C6BA5B

Sleep/Wake UUID: -FE18-47F9-9A4EF2935C96

Time Awake Since Boot: 29000 seconds Time Since Wake: 1900 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_INSTRUCTION (SIGABRT) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY

Application Specific Information: dyld3 mode abort() called.
x
x
x
x
External Modification Summary: Calls made by other processes targeting this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by this process: task_for_pid: 0 thread_create: 0 thread_set_state: 0 Calls made by all processes on this machine: task_for_pid: 0 thread_create: 0 thread_set_state: 0

VM Region Summary: ReadOnly portion of Libraries: Total=574.8M resident=0K(0%) swapped_out_or_unallocated=574.8M(100%) Writable regions: Total=356.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=356.4M(100%)

                            VIRTUAL   REGION 

REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Activity Tracing 256K 1 Kernel Alloc Once 32K 1 MALLOC 105.2M 32 MALLOC guard page 96K 5 MALLOC_MEDIUM (reserved) 240.0M 2 reserved VM address space (unallocated) STACK GUARD 56.1M 4 Stack 10.6M 4 VM_ALLOCATE 1.0G 4 VM_ALLOCATE (reserved) 12K 1 reserved VM address space (unallocated) __AUTH 273K 64 __AUTH_CONST 3528K 153 __DATA 1616K 162 __DATA_CONST 4536K 173 __DATA_DIRTY 313K 63 __LINKEDIT 490.7M 27 __OBJC_CONST 437K 41 __OBJC_RO 75.1M 1 __OBJC_RW 2576K 1 __TEXT 84.2M 185 __UNICODE 588K 1 shared memory 32K 2 =========== ======= ======= TOTAL 2.1G 927 TOTAL, minus reserved VM space 1.8G 927

Anvil
  • 865
  • 1
  • 6
  • 13

4 Answers4

44

Solved by using homebrew
brew install cocoapods

Anvil
  • 865
  • 1
  • 6
  • 13
  • 2
    I was already pissed, but you saved my night. – Marc Nov 25 '21 at 19:25
  • I tried many ways to solve this problem. Open rosetta Xcode, Terminal. Uninstall cocoapods and tried other versions. Finally it worked for me – serkanmalagic Dec 12 '21 at 20:22
  • 1
    Make sure you don't have previously installed cocoapods with gem. If so - uninstall it first by typing sudo gem uninstall cocoapods. – user-123 Dec 26 '21 at 21:42
  • It did the trick for me, but only after removing cocoapods as a gem (?) https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine – iuliu.net Jan 27 '22 at 21:10
  • For M1 Chip follow below URLs https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr https://developer.apple.com/forums/thread/652822 – Nisarg Thakkar Apr 22 '22 at 07:12
11

I had the same issue, but just had to close all instances of my terminal windows after installing cocoapods.

Evan
  • 121
  • 1
  • 2
  • After few tens of installing with gem, and/or brew, and trying many many things. Just restart terms has worked like it was magic. incomprehensible THANK YOU – Romain TAILLANDIER Feb 14 '22 at 15:50
8

Try using Rosetta terminal

Locate Terminal.app in Finder. (Applications->Terminal.app)
Right-click and choose Get Info
Check the “Open using Rosetta”
Quit all instances of Terminal app and run it again
Run sudo gem install ffi
Run pod install

https://armen-mkrtchian.medium.com/run-cocoapods-on-apple-silicon-and-macos-big-sur-developer-transition-kit-b62acffc1387

Prakash S
  • 492
  • 4
  • 9
1

Closing all instances of Terminal, then re-opening terminal and running pod install in the relevant directory did the job for me :)