Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error installing a pod - Bus Error at 0x00000001045b8000

I'm just learning to use cocoapods and am encountering an error when trying to install a pod.

Top of error:

/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/lib/ffi/library.rb:275: [BUG] Bus Error at 0x00000001045b8000 ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20]

Bottom of error:

zsh: abort pod install

Have tried the following, as suggested on some threads here and GitHub:

  • Uninstalling and re-installing cocoapod
  • sudo gem install xcodeproj
  • sudo gem update

but nothing seems to be working; the error persists and the .xcworkspace file doesn't appear.

Any help would be much appreciated. Thank you!

like image 995
turtlespeed Avatar asked Jul 28 '21 02:07

turtlespeed


3 Answers

If the other solution (sudo arch -x86_64 gem install ffi) does not work for you, try the following one instead:

gem install --user-install ffi -- --enable-libffi-alloc

After that, run pod install or whatever you were trying to do again, but without prefixing it with arch -x86_64.

It worked for me without issues and this way I could also avoid going the Intel emulation (Rosetta 2) way.

I find this solution in an issue filed on the ffi github project.

like image 146
Raphael Avatar answered Nov 04 '22 23:11

Raphael


I came across someone having this issue a while ago and I believe one of the suggestions made was to try the following:

install gem using

sudo arch -x86_64 gem install ffi

and then run this

arch -x86_64 pod install

it might work, it might not, I'm not too sure. This is because from the arm64 part of your error message I assume you have an M1 Mac. Either way it's probably worth a try.

like image 31
CloakedArrow Avatar answered Nov 04 '22 23:11

CloakedArrow


Reinstalling CocoaPods with brew and removing ffi gem solved the issue for me.

sudo gem uninstall cocoapods
sudo gem uninstall ffi
brew install cocoapods
pod install
like image 43
kandaurov_net Avatar answered Nov 04 '22 22:11

kandaurov_net