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
This is an issue with some OpenSSL libraries. So quick fix:
ln -s /usr/local/Cellar/[email protected]/1.1.1d/lib/libcrypto.dylib /usr/local/lib/libcrypto.dylib
ln -s /usr/local/Cellar/[email protected]/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.
-
Get fresh libs
brew update && brew upgrade && brew install openssl
-
Find openssl directory e.g.
cd /usr/local/Cellar/[email protected]/1.1.1/lib
(mine is1.1.1
, your can be newer!) -
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
-
mv libssl.dylib libssl_bak.dylib
-
mv libcrypto.dylib libcrypto_bak.dylib
Create new links:
7) sudo ln -s libssl.1.1.1.dylib libssl.dylib
sudo ln -s libcrypto.1.1.1.dylib libcrypto.dylib
Thanks for the gist, really helpful 😄