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

250,037

Solution 1

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

brew install rbenv/tap/[email protected]
ln -sfn /usr/local/Cellar/[email protected]/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...

Solution 2

December 2020 This thread has many answers, but none worked for me.
The top answer also suggests a downgrade:

brew switch ... throws Calling brew switch is disabled!

this worked for me:

brew install rbenv/tap/[email protected]
ln -sfn /usr/local/Cellar/[email protected]/1.0.2t /usr/local/opt/openssl

found here: https://github.com/kelaberetiv/TagUI/issues/86
(I need to run old mongodb 3.4 on OSX 10.13.x)

Solution 3

brew switch openssl 1.0.2s

worked for me on "macOS Mojave", "version 10.14.6".

Solution 4

Try to use install_name_tool:

sudo install_name_tool -change /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/opt/openssl/lib/libssl.1.1.dylib $(which vapor)
sudo install_name_tool -change /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/opt/openssl/lib/libcrypto.1.1.dylib $(which vapor)

In my case it start working when I used install_name_tool. The order of the parameter is following: old value (incorrect), then new value (where you have your openssl) and the path to vapor (which can be easily get by $(which vapor).

Solution 5

first, list the details of the installed openssl version(or other programs) by:

$ls -al /usr/local/Cellar/openssl*
/usr/local/Cellar/openssl:
total 0
drwxr-xr-x    3 mba  staff    96 Nov 30 17:18 .
drwxrwxr-x  170 mba  admin  5440 Apr  8 02:03 ..
drwxr-xr-x   13 mba  staff   416 Nov 21 03:13 1.0.2t

/usr/local/Cellar/[email protected]:
total 0
drwxr-xr-x    4 mba  staff   128 Apr  7 18:35 .
drwxrwxr-x  170 mba  admin  5440 Apr  8 02:03 ..
drwxr-xr-x   14 mba  staff   448 Oct  1  2019 1.1.1d
drwxr-xr-x   14 mba  staff   448 Apr  7 18:35 1.1.1f

as above output, there are only one "right" versions "openssl" in my mac. then, switch to it:

$brew switch openssl 1.0.2t                                 
Cleaning /usr/local/Cellar/openssl/1.0.2t
Opt link created for /usr/local/Cellar/openssl/1.0.2t
Share:
250,037
Cronay
Author by

Cronay

Updated on July 12, 2022

Comments

  • Cronay
    Cronay almost 2 years

    I installed vapor via homebrew and then immediately wanted to jump into a project by executing vapor new Hello but then got the following message back in the terminal:

    dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
    Referenced from: /usr/local/bin/vapor
    Reason: image not found
    zsh: abort      vapor new Hello
    

    I tried some approaches to fix this like uninstalling and reinstalling openssl via brew but that didn't work . Also tried something I found in the internet but nothing worked. I assume it has something to do with vapor only working with version 1.0.0 but not 1.1.1 and that's what I have. I guess I need to downgrade to 1.0.0 but how'd I do that? I'm on MacOS Catalina if that matters.

  • tom10271
    tom10271 over 4 years
    brew update && brew upgrade will upgrade all packages, it causes HUGE problem
  • tom10271
    tom10271 over 4 years
    This is the best solution and simplest. Yet Homebrew will remove packages that are deprecated. Not sure when will this solution stop working
  • Aman Raheja
    Aman Raheja over 4 years
    You know, you are a diamond
  • macool
    macool over 4 years
    yeah please remove brew upgrade from the answer @michal-cichon
  • Cronay
    Cronay over 4 years
    @Leopathu can you elaborate why this should be the approved answer and not the one I approved? If this is the better answer I still can approve it.
  • Ishmael7
    Ishmael7 over 4 years
    This one worked for me because I required a version of openssl which contained libssl.1.0.0.dylib. The latest version of openssl contains libssl.1.1.dylib.
  • juanitourquiza
    juanitourquiza over 4 years
    This work for me with a little change the last letter "r" brew switch openssl 1.0.2r on MacOS Catalina
  • Gold Chicken
    Gold Chicken over 4 years
    best solution. brew switch openssl 1.0.2t in my case
  • flurdy
    flurdy over 4 years
    I just upgraded the client tool, not vapor but wget in my case. Which then used a later version of openssl brew upgrade vapor
  • Isaac Philip
    Isaac Philip about 4 years
    Thanks my Tableau 2019.10.3 was not opening in Mac OS Mojave and this command helped solve that!
  • Zheden
    Zheden about 4 years
    @MichalCichon could you please explain what is the vapor? "which vapor" gives me empty result and command cannot be executed
  • Michal Cichon
    Michal Cichon about 4 years
    @Zheden Vapor is a web framework implemented in Swift. Please take a look at the original question in this thread. If you don't know what Vapor is then this thread probably doesn't answer your question. If you use Homebrew to manage your dependencies, try Smokie's answer.
  • Michal Cichon
    Michal Cichon about 4 years
    Thanks @musafar006. I didn't notice I copied a wrong path in the second command.
  • Evhz
    Evhz about 4 years
    brew switch openssl 1.0.2p
  • Uncle Long Hair
    Uncle Long Hair about 4 years
    thank you I can't imagine how much time you must have saved me. My openssl broke after upgrading my Mac to Catalina.
  • ricks
    ricks about 4 years
    I had to upgrade and update brew before this worked
  • Gonzalo Garcia
    Gonzalo Garcia about 4 years
    Why @Cronay is this still the correct answer? can u changed to the most voted ?
  • Cronay
    Cronay about 4 years
    If you make a good argument, I do it. What's bettwr about that answer than this the approved one? I once asked this and nobody answered me, so I left it as it is.
  • AntonAL
    AntonAL about 4 years
    It works for me (macOS Catalina, ruby 2.4.1, rails 5.2.2, openssl 1.1.1f). Switched to 1.0.2s.
  • squarecandy
    squarecandy about 4 years
    I felt like @smokie deserved the upvote for being there first with the right approach vs. all of the other answers that just say which +1 letter version number worked for their exact setup...
  • Taher
    Taher about 4 years
    @Cronay, although the question involved vapor and this answer's approach has solved it for you. I am sure, many others like me, came here after a certain setup stopped working due to an OS upgrade (in my case it was PHP7.2, after upgrading to Catalina, it suddenly stopped working and produced an error like in the title) - which means this question helped many many others - and that is great :)
  • Cronay
    Cronay about 4 years
    @Smokie And what technical advantages has the most voted solution in comparison?
  • Taher
    Taher about 4 years
    @Cronay, the marked answer solves an issue involving vapor, my answer solves the issue mentioned in the title (not being able to load the openssl library). both are correct answers in my opinion.
  • techturbulence
    techturbulence about 4 years
    On my High Sierra 10.13.6 brew switch openssl 1.0.2t worked
  • Martynas Jurkus
    Martynas Jurkus about 4 years
    I spent a whole day installing, reinstalling rails versions, mysql2 gems with various flags and options. This worked like a charm! Thanks mate!
  • Tony Dinh
    Tony Dinh about 4 years
    Guys from Google, the actual answer is here.
  • Inanc Gumus
    Inanc Gumus about 4 years
    brew switch openssl 1.0.2s worked for me on Catalina.
  • calebisstupid
    calebisstupid about 4 years
    just stopping to say thanks. i had done all sorts of weird stuff trying to get a one off project building and this solved my issues
  • Salx
    Salx about 4 years
    thankyouthankyouthankyou! worked here with 1.0.2r. On High Sierra.
  • michaelsking1993
    michaelsking1993 almost 4 years
    Wow. I thought I was screwed until I found this. Ran a series of commands to install Python/Flask, then all my RSpec tests were failing. Thank you...
  • Sebastian Korotkiewicz
    Sebastian Korotkiewicz almost 4 years
    brew switch openssl 1.0.2t Work for me on "macOS Mojave"
  • Petrus Theron
    Petrus Theron almost 4 years
    Thanks, brew switch openssl 1.0.2r fixed my `psql install on OSX (I use PostgresApp).
  • Krzysztof Bociurko
    Krzysztof Bociurko almost 4 years
    Simplest solution, openssl was in a correct and up to date version, but the stuff that crashed needed to be updated.
  • FloG
    FloG almost 4 years
    Fixed it for me.
  • AlxVallejo
    AlxVallejo almost 4 years
    invalid option: --upgrade
  • kthornbloom
    kthornbloom almost 4 years
    saved my bacon!
  • iwind
    iwind almost 4 years
    brew switch openssl 1.0.2r works for me, thank you. and 'ls -al /usr/local/Cellar/openssl' is the key.
  • David Mann
    David Mann almost 4 years
    Thanks so much for this. What shows that 1.0.2t is the "right" version? I have a 1.0.2r and a 1.1.1d and 1.1.1f.
  • user3325025
    user3325025 almost 4 years
    similar works for me on macos high sierra 10.13.6 python3.6
  • Don't Panic
    Don't Panic almost 4 years
    there are only one "right" versions - what does this mean? How do you tell?
  • little tiny man
    little tiny man almost 4 years
    I don't even fully understand this issue but this worked for me
  • Shane Fontaine
    Shane Fontaine over 3 years
    This worked for me on August 4th, 2020. As a note, the original, accepted answer had worked for me on July 16th, 2019 but did not work today.
  • Justin Meskan
    Justin Meskan over 3 years
    very good this worked for me.. when all the rest failed..lol thanks
  • Anna Costalonga
    Anna Costalonga over 3 years
    this hint saved me hours and hours, great advice for Mac users!
  • Tom Pace
    Tom Pace over 3 years
    I've just begun having problems with brew; and coming here and getting a holistic take on the behaviours... Am I alone in thinking brew is reducing as a valuable project? If it removes deprecated content, and I'm using various systems with dependencies that are merely a couple years old, and dependencies are dropped... If to resolve issues, the solutions require a manual investment in seeking sources and making... kinda makes the value of being a dependency manager moot. I need to talk in a community forum about this issue.
  • Kevin Ford The Submariner
    Kevin Ford The Submariner over 3 years
    I agree with your concerns @Jerry and I hit upon what I think may have been a quicker solution than yours using MichalCichon's answer as a starting point. Good idea to rebuild from sources rather than downgrade your openssl lib version, but I'm guessing you know already that can be an extremely time-consuming process. Thanks for posting your answer.
  • Johhn
    Johhn over 3 years
    brew uninstall --ignore-dependencies openssl brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/30f‌​d2b68feb458656c2da2b‌​91e577960b11c42f4/Fo‌​rmula/openssl.rb
  • Travis Spencer
    Travis Spencer over 3 years
    If this works for you, you should consider yourself lucky. The API between 1.0 and 1.1 was pretty different and most things that depend on 1.1 will not work with 1.0.
  • Ryzal Yusoff
    Ryzal Yusoff over 3 years
    For me on Catalina this is working: brew switch openssl 1.0.2j
  • yegor256
    yegor256 over 3 years
    What should I do if I don't have any "older" versions installed on my Mac, but just 1.1.1g?
  • RaphaelDDL
    RaphaelDDL over 3 years
    I'm getting Error: openssl not found in the Cellar. when trying to switch, any ideas?
  • Babbz77
    Babbz77 over 3 years
    When running ls -al /usr/local/Cellar/openssl did anyone get ls: /usr/local/Cellar/openssl: No such file or directory?
  • Andreas Ley
    Andreas Ley over 3 years
    That was the only solution that did the trick for me. Additionally, I had to create a link so that Vapor would find it: ln -s /usr/local/Cellar/[email protected]/1.0.2t /usr/local/opt/openssl
  • Tarantula
    Tarantula over 3 years
    Same here, probably after an upgrade of homebrew it removed it.
  • AlxVallejo
    AlxVallejo over 3 years
    No available formula or cask with the name "[email protected]"
  • AlxVallejo
    AlxVallejo over 3 years
    Calling Installation of openssl from a GitHub commit URL is disabled! Use 'brew extract openssl' to stable tap on GitHub instead.
  • AlxVallejo
    AlxVallejo over 3 years
    Error: openssl not found in the Cellar
  • abbood
    abbood over 3 years
    Error: Calling Non-checksummed download of openssl formula file from an arbitrary URL is disabled! Use 'brew extract' or 'brew create' and 'brew tap-new' to create a formula file in a tap on GitHub instead. If reporting this issue please do so at (not Homebrew/brew or Homebrew/core): github.com/tebelorg/Tump/issues/new
  • abbood
    abbood over 3 years
    brew search openssl ==> Formulae curl-openssl ✔ glib-openssl [email protected] homebrew/portable-ruby/portable-openssl only 1.1 is available now
  • juanitourquiza
    juanitourquiza over 3 years
    This worked for me in October 2020. My project uses Symfony 5
  • juanitourquiza
    juanitourquiza over 3 years
    This worked for me in October 2020. My project uses Symfony 5
  • Soyaine
    Soyaine over 3 years
    @yegor256 how about ls -al /usr/local/Cellar/openssl*?
  • AlxVallejo
    AlxVallejo over 3 years
    @Soyaine That just gives me the latest 1.1.1g
  • Tchakabam
    Tchakabam over 3 years
    i don't think it is a good idea to downgrade a security relevant component as this.
  • AlxVallejo
    AlxVallejo over 3 years
    no such file or directory: /usr/local/opt/openssl/lib/
  • lucasarruda
    lucasarruda over 3 years
    As Andreas stated, you still have to symlink. But Andreas command is backwards. It should actually read ln -s /usr/local/opt/openssl /usr/local/Cellar/[email protected]/1.0.2t
  • lucasarruda
    lucasarruda over 3 years
    I think this is the correct solution. I did this a couple of times and it worked. I just forgot about it and end up here. So, just confirming this is a good solution that is future proof. Just make sure you create the exact erring lib version (1.0.0, 1.0.1, or 1.0.2), depending on the error you are getting.
  • allenski
    allenski over 3 years
    Please share code with your answer and link at end for reference. want to avoid link-only answers in case that page stops working or changes.
  • Joshua Pinter
    Joshua Pinter over 3 years
    This fixed it for me. Thanks.
  • Darwin Harianto
    Darwin Harianto over 3 years
    To install that GitHub link, we need to downgrade brew. cd /usr/local/Homebrew/ change to version 2.3.0 git checkout 2.3.0 then install HOMEBREW_NO_AUTO_UPDATE=1 brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/op‌​enssl.rb github.com/kelaberetiv/TagUI/issues/635#issuecomment-6994829‌​20
  • Chris Edwards
    Chris Edwards over 3 years
    This fixed it for me too, however the first time I ran it it did not. I had to brew uninstall postgresql@12 then re-run brew postgresql-upgrade-database which fixed it.
  • Janosch
    Janosch over 3 years
    or brew tap cartr/qt4 && brew install cartr/qt4/[email protected]
  • Ignacio
    Ignacio over 3 years
    this worked for me, nov 2020 using "get github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb‌​"
  • Randomtheories
    Randomtheories over 3 years
    Worked. Just manually downloaded the file.
  • Lucas C. Feijo
    Lucas C. Feijo over 3 years
    This worked for me, but you have to do --ignore-dependencies.
  • Lance Cleveland
    Lance Cleveland over 3 years
    Brew on MacOS no longer supports OpenSSL 1.0.X -- you'll need to manually fetch the older brew core from git, checkout the commit, and install the older openSSL libs from there. See izziswift.com/openssl-1-0-2m-on-macos
  • Tracy McCormick
    Tracy McCormick over 3 years
    just a fyi I tried the wget but got the following dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib Referenced from: /usr/local/bin/wget Reason: image not found Abort trap: 6
  • kawingkelvin
    kawingkelvin over 3 years
    I have python3.8 that use openssl 1.1 and another virtualenv on python 3.7 that used openssl1.0. While brew install, it must have deleted openssl1.0. If i brew reinstall the old version and use "switch", would it break the python3.8 venv?
  • Moshe D
    Moshe D over 3 years
    Wow people should look for this, this on the only that helped me!!
  • chris
    chris over 3 years
    brew install rbenv/tap/[email protected] took forever! But finally a solution that worked for me using macOS Big Sur, thanks @angabriel!
  • Parth Tamane
    Parth Tamane over 3 years
    Was facing the same issue when running sudo gem install cocoapods. This helped, thanks!
  • deyvw
    deyvw over 3 years
    "brew switch" is already disabled. So what then?
  • chifu lin
    chifu lin over 3 years
    This solution that worked for me using macOS Big Sur, thanks
  • chompy
    chompy over 3 years
    Worked on macOS Mojave fyi, thank you for the workaround!
  • frakman1
    frakman1 about 3 years
    This worked for me on High Sierra with /usr/local/Cellar/mysql/5.7.20/bin/mysqld
  • Maurits
    Maurits about 3 years
    Worked for me as well! Thank you!
  • iCyborg
    iCyborg about 3 years
    @LucasC.Feijo can you give the full command with --ignore-dependencies?
  • Lucas C. Feijo
    Lucas C. Feijo about 3 years
    @iCyborg --ignore-dependencies is a parameter to the brew binary, so you'd call it like brew install nameOfPackage --ignore-dependencies
  • tigeruppercut
    tigeruppercut about 3 years
    Thank you. I was stuck for 2 days.
  • angabriel
    angabriel about 3 years
    Did you read my answer? It states that I also tried brew switch and downgrading. "I tried the below solution"... Over time things did change. The accepted answer cannot be not valid forever when not updated. Also creating symlinks is better than copying around systemfiles.
  • Ecuador
    Ecuador about 3 years
    MacOS 11.2.3, worked like a charm, thanks!
  • Bart Jonk
    Bart Jonk about 3 years
    @deyvw: check out the answer below: brew install rbenv/tap/[email protected] | ln -sfn /usr/local/Cellar/[email protected]/1.0.2t /usr/local/opt/openssl
  • Taher
    Taher about 3 years
    My (this) answer has become outdated, brew switch got disabled, openssl 1.* wouldn't be installed out of the box nowadays. I suggest moving the correct answer to the one below (by @angabiel)
  • Anthony
    Anthony about 3 years
    @BartJonk you should pull that out into its own answer, that's the correct approach
  • AppDever
    AppDever almost 3 years
    Hours and hours trying to install cocoapods and I came across this and was hopeful as I too have an M1 with Big Sur but this did not work for me.... I get this: x86_64cpuid.s:273:10: error: unknown token in expression cmpq $0,%rax (with a ^ pointing to the %)
  • user2233949
    user2233949 over 2 years
    @Bart Jonk I agree with Anthony. That should be in its own answer. In 2021, that's the only thing that worked for me after trying a lot of different approaches
  • Brad Johnson
    Brad Johnson over 2 years
    For all the other solutions, brew seemed to need git (which is what was not working for me). This is the only solution I found that downloads files and installs them without git.
  • Dan In Van
    Dan In Van over 2 years
    Worked in Sept. 2021 on Mojave (the only thing that worked).
  • Ole Spaarmann
    Ole Spaarmann over 2 years
    When trying to install [email protected] on macOS 12.1 Monterey on a MacBook M1 the make command fails. Does anyone have a solution for that?
  • Pradeep shyam
    Pradeep shyam about 2 years
    This worked well for Macos Monterey as well :)
  • Ovi Trif
    Ovi Trif about 2 years
    To inform newcomers here, this doesn't work on M1 with a arm64 build of brew
  • fguillen
    fguillen about 2 years
    Works for me in MacOS Catalina 10.5.5
  • wbr
    wbr almost 2 years
    After searching for a couple of hours to a solution for broken 'heroku pg:psql' on Mac Mojave with Homebrew, this is the only solution that helped. Thank you!