Error installing a pod - Bus Error at 0x00000001045b8000
Asked Answered
C

3

71

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!

Candida answered 28/7, 2021 at 2:58 Comment(0)
M
193

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.

Muliebrity answered 4/1, 2022 at 15:36 Comment(11)
Worked like a charm on M1 MaxFourchette
Oh this should definitely be the top answer. This works like a charm, and doesn't require any emulation!Boomkin
Worked on my M1 Pro as well. Did gem install --user-install ffi -- --enable-libffi-alloc and then normal pod install and compiled the project. All good.Langton
Searched for hours to fix this issue, this finally fixed it (M1 Max). Thank you!Schwenk
It worked for M1 pro as well. ThanksExpostulate
It worked, in my case had to pod repo update after using the above commands.Gulp
This also works on M2 AirBootle
If anyone having older ffi installed via sudo gem install ffi then have to uninstall that and run the above with sudo then it will works, thanks!Mcmurry
worked for M1 Max.. big thanks!Vaporization
Works for M1, much appreciated!Flatting
Just the --enable-libffi-alloc flag is enough I think. gem install ffi -v 1.14.0 -- --enable-libffi-alloc worked for me on M3Broeker
T
37

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.

Tyrant answered 28/7, 2021 at 6:51 Comment(3)
I got an error when trying the first step: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.Candida
This looks like an issue with libyaml and ruby. Again, I'm not too experienced with working on cocoapods and programming with mac in general but try these steps below: Step 1: brew install libyaml (Check installation) Step 2: brew info libyaml (this should've brought up some text showing version number etc) Step 3: try the above steps I've provided If this works or doesn't work please let me know, as I'm learning as well Thanks.Tyrant
In some case, run arch -x86_64 pod update to make app build on iOS simulatorDoorstone
L
27

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
Lanell answered 19/5, 2022 at 23:25 Comment(4)
Thanks, It worked. Existing x86 version was creating issuesItol
Also worked for me. I had existing x86 version clashing.Blackmon
Worked for me on Macbook Pro 13" M2 chipAmby
This worked well for me on a M1 mac! Looks like I had multiple ffi's installed that was causing issues.Python

© 2022 - 2024 — McMap. All rights reserved.