Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save claui/3fb9f66bc2cfdecd0c33c3f976cc6125 to your computer and use it in GitHub Desktop.
Save claui/3fb9f66bc2cfdecd0c33c3f976cc6125 to your computer and use it in GitHub Desktop.
[SOLVED] Please help me get Homebrew working again on the DTK

Update: SOLVED

Thanks to @indirect’s help, I’m back up and running. Turns out there’s that directory /Library/Ruby/Gems/2.6.0/specifications/default. It contains a couple of gemspecs you really can’t (and shouldn’t ever) delete.

With the default gemspecs back in place, I was able to apply the fiddle hack mentioned below, and got Homebrew working again.


Original issue

My DTK gives me the dreaded symbol '_ffi_prep_closure' not found error after I deleted /Library/Ruby.

The following workaround no longer has any effect for me:

cd "$(mktemp -d)" \
  && git clone https://github.com/ruby/fiddle \
  && cd fiddle \
  && bundle install --path vendor/bundle \
  && bundle exec rake build \
  && sudo gem install pkg/fiddle-1.0.1.gem

Would appreciate any pointers so I can avoid setting up the whole machine from scratch.

Am on Big Sur Beta 3, Xcode 12 Beta 3.

Output of /usr/bin/ruby -rfiddle -e '':

Traceback (most recent call last):
	4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
	2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/fiddle.rb:2:in `<top (required)>'
	1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/fiddle.bundle, 0x0009): symbol '_ffi_prep_closure' not found, expected in flat namespace by '/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/fiddle.bundle' - /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/fiddle.bundle (LoadError)
@ahmetbostanciklioglu
Copy link

It's a life saver comment, thanks for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment