Library Not Loaded: /Opt/Local/Lib/Libssl.1.0.0.Dylib (Loaderror)

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

Update: As of December 2020 and beyond, brew switch does not work, so use the other answer by @angabriel:

brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl

Original Answer:
Switch to an older openssl package

brew switch openssl 1.0.2s

Or, depending on your exact system configuration, you may need to switch to a different version. Check the output of ls -al /usr/local/Cellar/openssl for the version number to switch to.

brew switch openssl 1.0.2q
# or
brew switch openssl 1.0.2r
# or
brew switch openssl 1.0.2s
# or
brew switch openssl 1.0.2t
# etc...

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

Update: As of December 2020 and beyond, brew switch does not work, so use the other answer by @angabriel:

brew install rbenv/tap/openssl@1.0
ln -sfn /usr/local/Cellar/openssl@1.0/1.0.2t /usr/local/opt/openssl

Original Answer:
Switch to an older openssl package

brew switch openssl 1.0.2s

Or, depending on your exact system configuration, you may need to switch to a different version. Check the output of ls -al /usr/local/Cellar/openssl for the version number to switch to.

brew switch openssl 1.0.2q
# or
brew switch openssl 1.0.2r
# or
brew switch openssl 1.0.2s
# or
brew switch openssl 1.0.2t
# etc...

Library not loaded: /opt/local/lib/libssl.1.0.0.dylib (LoadError)

Your questions mentions three paths /opt/local, /usr/local and /etc/openssl they belong to Macports, Homebrew and SM Framework respectively.

As the last one is used to build static rubies it is harmeless and not related to the problem. The other two suggest that you have switched from macports to homebrew between installing the rubies.

You need to reinstall ruby-2.0.0-p195 which is referring still the old paths from macports, you can do it with:

rvm reinstall ruby-2.0.0-p195

You can get more details about the rubies and openssl paths they use running:

rvm --debug osx-ssl-certs update all

openssl@1.1 not used? dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib

In short: Check the libraries referencing the missing dynamic library, and confirm you've re-built them after changing openssl versions as well.

You can rebuild either via a version upgrade with brew upgrade or a reinstallation of the problematic package via brew reinstall.

Why? Homebrew does not appear to consider libssh2 a dependent of openssl@1.1, and thus does not rebuild it automatically as it otherwise would.


Investigatory debug process:

After wracking my brain, google, and SO for an hour, I took yet another look at the failure:

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib
Reason: image not found

From there, I noticed that libssh2 was the cause of the failed reference:

  Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib

On a whim, I checked the version of libssh2 homebrew had installed:

$ brew info libssh2
libssh2: stable 1.9.0 (bottled), HEAD
C library implementing the SSH2 protocol
https://libssh2.org/
/usr/local/Cellar/libssh2/1.8.0 (182 files, 798.7KB) *
Poured from bottle on 2018-11-14 at 17:45:34
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libssh2.rb
License: BSD-3-Clause
==> Dependencies
Required: openssl@1.1 ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 38,765 (30 days), 110,674 (90 days), 607,725 (365 days)
install-on-request: 2,946 (30 days), 4,789 (90 days), 19,954 (365 days)
build-error: 0 (30 days)

Ah, that might be it! This was installed back in 2018!

  Poured from bottle on 2018-11-14 at 17:45:34

One brew upgrade libssh2 later and we're in business

==> Upgrading 1 outdated package:
libssh2 1.8.0 -> 1.9.0_1
==> Upgrading libssh2 1.8.0 -> 1.9.0_1
==> Downloading https://homebrew.bintray.com/bottles/libssh2-1.9.0_1.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/327c56ad6a54894e5ef9aa3019d2444d32f1d0fba80925940100e517dd3109c9?response-content-disposition=attachment%3Bfilename%3D%22libssh2-1.9.0_1.mojave.bottle.tar.gz%22&Policy
######################################################################## 100.0%
==> Pouring libssh2-1.9.0_1.mojave.bottle.tar.gz
/usr/local/Cellar/libssh2/1.9.0_1: 184 files, 942KB
Removing: /usr/local/Cellar/libssh2/1.8.0... (182 files, 798.7KB)

...

And from there, our initial problem is resolved:

$ pyenv install -v 3.8.2
pyenv: /Users/fire/.pyenv/versions/3.8.2 already exists
continue with installation? (y/N) y
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918 ~/projects
Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz

08/07 11:53:54 [NOTICE] Downloading 1 item(s)
[#25162c 0B/0B CN:1 DL:0B]

08/07 11:53:55 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
[#25162c 9.0MiB/17MiB(52%) CN:1 DL:9.8MiB]

08/07 11:53:56 [NOTICE] Download complete: /private/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2.tar.xz

Download Results:
gid |stat|avg speed |path/URI
======+====+===========+=======================================================
25162c|OK | 9.9MiB/s|/private/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2.tar.xz

Status Legend:
(OK):download completed.
/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2 /var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918 ~/projects
Installing Python-3.8.2...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
checking build system type... x86_64-apple-darwin18.7.0

...

mysql2: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib after homebrew update

OpenSSL 1.0 reached EOL on 2019-12-31

Reinstalling mysql2 gem with --with-cflags and --with-ldflags arguments pointing to openssl@1.1 fixed the error:

gem uninstall mysql2
gem install mysql2 -v 0.4.4 -- --with-cflags=\"-I/usr/local/opt/openssl@1.1/include\" --with-ldflags=\"-L/usr/local/opt/openssl@1.1/lib\"

bundle install

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib when running nginx and mysql after macOS upgrade to Catalina

I had the same issue, not for upgrading to Catalina but because of installing a program which upgrade my version of OpenSSL, so it brokes other apps which depended on OpenSSL.
In my case Ruby (2.3.8 with RVM) and MySQL (MariaDb in fact). In the case of Ruby, it was incompatible with the new version of OpenSSL, so I had to install it with pkg depdendencies for RVM

rvm pkg install openssl
rvm reinstall 2.3.8 --with-openssl-dir=$HOME/.rvm/usr

In the case of MySQL I just upgraded it, so it got installed with the new openSSL on my System.

brew upgrade mariadb

Thats solves my issues. I think in your case you could upgrade (or uninstall and reintall) MySQL and Nginx, so they will correctly use the new version of OpenSSL.

(P.D. In the case of MySQL it conserved my databases without problems)



Related Topics



Leave a reply



Submit