Ruby segfault on M1 Macbook 16 Jul 2021

Apparently my M1 Macbook Air is able to cope with anything, except Ruby, or the ffi gem, specifically. My script crashed with the following: /Users/XYZ/.gem/ruby/2.6.0/gems/ffi-1.15.3/lib/ffi/library.rb:275: [BUG] Bus Error at 0x0000000100cd4000

Worry not, here’s the solution:

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

I wish this had been documented properly, instead of being casually mentioned in a bug report comment.

« Home All posts