Library Not Loaded: /Usr/Local/Opt/Readline/Lib/Libreadline.6.Dylib (Loaderror)

Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)

This command fix my problem:

ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

OR

ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

I wrote a Gist about this problem here. There are many people sharing their solutions there too.

Library not loaded: /usr/local/opt/readline/lib/libreadline.6.2.dylib

I was getting the exact same error, but the above answers didn't work for me. I had to reinstall postgresql.

brew reinstall postgresql

rails 5, rbenv - rails console doesn't start - Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)

I found 2 solutions from some researching.

Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib (LoadError)
  1. libreadline.7.dylib is missing, so linking libreadline.8.0.dylib to libreadline.7.dylib worked for me.

    ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

libreadline version might be different. You can browse available files in /usr/local/opt/readline/lib/ directory.


  1. rb-readline gem in development group would fix this problem.

    gem 'rb-readline'

rails console doesn't load due to libreadline

Ran across this today, to solve it I did:

brew rm -f readline

brew install readline

brew link readline --force

Hope it helps.

EDIT: I recently ran into this problem again (after downgrading Ruby) since I wrote this, and I now prefer @califrench's solution from the comments below:

ln -s /usr/local/opt/readline/lib/libreadline.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

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...

IRB not loading library libreadline

You may have upgraded something that replaced the readline library and it's now necessary to rebuild your Ruby. This sort of thing happens infrequently with Homebrew when you run brew clean and it deletes an obsolete version of a dependency, not realizing one of your Ruby builds depends on it. This is because Rbenv has no way of communicating to Homebrew that it still needs that library.

This is usually easy to fix. Try:

rbenv install 2.4.2

You might also want to take the time to update to the latest version which is, as of today, 2.5.3.

dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac

Update - As stated in some of the comments, running brew cleanup could possibly fix this error, if that alone doesn't fix it, you might try upgrading individual packages or all your brew packages.

I just had this same problem. Upgrading Homebrew and then cleaning up worked for me. This error likely showed up for me because of a mismatch in package versions. None of the above solutions resolved my error, but running the following homebrew commands did.

Caution - This will upgrade all your brew packages, including, but not limited to PHP. If you only want to upgrade specific packages make sure to be specific.

brew upgrade icu4c

brew upgrade // or upgrade all packages

and finally

brew cleanup


Related Topics



Leave a reply



Submit