Skip to content

Instantly share code, notes, and snippets.

@ritaly
Last active April 19, 2022 15:53
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritaly/9ded38e1918e55b928ff357fbdf07417 to your computer and use it in GitHub Desktop.
Save ritaly/9ded38e1918e55b928ff357fbdf07417 to your computer and use it in GitHub Desktop.
Ruby macOS Catalina: Fixing the abort trap

where: macOS Catalina when: Homebrew’s / rvm after Ruby update to 2.6 or 2.7 fails with abort or Abort trap: 6.
pre: make sure you're using newest rvm version rvm get stable .

All rake and rails command crashed Noticed that rails tasks like rake or rails console, rails db:create, rails db:migrate (info - added only for better googling) these command crashed with the output aborted. No errors only with abord or Abort trap: 6

⚠️ check your local paths!

This is an issue with some OpenSSL libraries. So quick fix:

ln -s /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.dylib /usr/local/lib/libcrypto.dylib
ln -s /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libssl.dylib /usr/local/lib/libssl.dylib

Other case: The crash file revealed that the error message is: Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

  1. Get fresh libs brew update && brew upgrade && brew install openssl

  2. Find openssl directory e.g. cd /usr/local/Cellar/openssl@1.1/1.1.1/lib (mine is 1.1.1, your can be newer!)

  3. Make a copy of dylib sudo cp libssl.1.1.1.dylib libcrypto.1.1.1.dylib /usr/local/lib/

Backup the old ones: 4) cd /usr/local/lib

  1. mv libssl.dylib libssl_bak.dylib

  2. mv libcrypto.dylib libcrypto_bak.dylib

Create new links: 7) sudo ln -s libssl.1.1.1.dylib libssl.dylib

  1. sudo ln -s libcrypto.1.1.1.dylib libcrypto.dylib
@diogob
Copy link

diogob commented Jul 14, 2020

Thanks for the gist, really helpful 😄

@AndriiChubariev
Copy link

This worked for me as well, thanks!
The only difference, I had a different path on my machine:

Instead:
/usr/local/Cellar/openssl@1.1/1.1.1d
I had:
/usr/local/Cellar/openssl@1.1.1/1.1.1g

So be careful, do not blindly copy-paste shell command, and check your local paths.

@nnslvp
Copy link

nnslvp commented Apr 19, 2022

I prefer this:

sudo ln -s $(brew --prefix openssl)/lib/libcrypto.dylib /usr/local/lib/
sudo ln -s $(brew --prefix openssl)/lib/libssl.dylib  /usr/local/lib

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