Skip to content

Instantly share code, notes, and snippets.

@wbotelhos
Created November 29, 2016 20:42
Show Gist options
  • Star 58 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save wbotelhos/46c37807c834ccb5bb406e426adfe347 to your computer and use it in GitHub Desktop.
Save wbotelhos/46c37807c834ccb5bb406e426adfe347 to your computer and use it in GitHub Desktop.
Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib (LoadError)
ln -s /usr/local/opt/readline/lib/libreadline.7.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib
@eriknomitch
Copy link

eriknomitch commented Feb 26, 2019

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/awk

For anyone getting this error stemming from awk on macOS with Homebrew you probably need to update "gawk" (GNU awk).

brew upgrade gawk

@Mo0812
Copy link

Mo0812 commented Feb 26, 2019

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.7.dylib
Referenced from: /usr/local/bin/awk

For anyone getting this error stemming from awk on macOS with Homebrew you probably need to update "gawk" (GNU awk).

brew upgrade gawk

Thanks @eriknomitch this works perfect for me on macOS!

Copy link

ghost commented Mar 4, 2019

ln -s /usr/opt/local/lib/libreadline.8.0.dylib /usr/opt/local/lib/libreadline.7.dylib
worked for me in case of config.status: error: could not create libbitcoinconsensus.pc while building script for bitcoin

@damien-nd
Copy link

Thank you @eriknomitch. I prefer to upgrade than linking to the old one ;)

@floer32
Copy link

floer32 commented Mar 6, 2019

If the error you're getting is this:

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

...you'll need this variant instead:

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

(Note: Using Mac OS 10.13.5)

Same here, and this was the fix. Oh I actually did 8 instead of 8.0 and that works too.

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

And just in case it helps with people finding this thread, I'll mention I hit the error when I was installing shutit (https://github.com/ianmiell/shutit) (I will also note this over on their end)

@ZackNoyes
Copy link

If the error you're getting is this:

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

...you'll need this variant instead:

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

(Note: Using Mac OS 10.13.5)

Brilliant! Works perfectly macOS 10.14.3.

@dhhiep
Copy link

dhhiep commented Mar 11, 2019

That's awesome!!!

@idning
Copy link

idning commented Mar 12, 2019

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

Awesome!

@erwanlr
Copy link

erwanlr commented Mar 12, 2019

If you have the error with ruby and RVM, reinstalling the affected version of ruby will fix it. ie rvm reinstall 2.6.1

@sunnypatel
Copy link

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

Thank you!!!

@Aiden-Xi
Copy link

Aiden-Xi commented Mar 14, 2019

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

thank you!!!

@jaekunchoi
Copy link

awesome!

@hitripod
Copy link

great

@SuwalNikesh
Copy link

Awesome!!!

@VinayakAB2210
Copy link

Thank you!

@arkiver
Copy link

arkiver commented Mar 29, 2019

How to find version of readline you have installed:

brew info readline                                                                                  
readline: stable 8.0.0 [keg-only]

Then link your version to the one referenced by psql:

In my case: it was 6. This was the error I got:

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/bin/psql
  Reason: image not found

Then to link the referenced version with the one you have:

Backup old link
mv /usr/local/opt/readline/lib/libreadline.6.dylib /usr/local/opt/readline/lib/libreadline.6.dylib.bkp

Create new link
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.6.dylib

Optional: Remove backed up link
rm /usr/local/opt/readline/lib/libreadline.6.dylib.bkp

@roslyn-huang
Copy link

Thank you so much!!!!

@alejandrogarza
Copy link

Thanks!

@xueTP
Copy link

xueTP commented Apr 22, 2019

Thanks!

@arejae
Copy link

arejae commented Apr 23, 2019

brew install readline
sudo cp /usr/local/Cellar/readline/8.0.0/lib/8 /usr/local/opt/readline/lib/

it works for me.

@ocroopesh
Copy link

Thank you !!!

@vgoncharenko
Copy link

thanks!

@esebelekewek
Copy link

thank you

@ianrandmckenzie
Copy link

I really messed things up somewhere and had to do the following:

brew uninstall --ignore-dependencies readline
brew install readline
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

You may also need to do:

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

@A1vinSmith
Copy link

If you get /usr/local/opt/readline/lib/libreadline.6.dylib: File exists when you run this, you can instead brew install readline and copy the version-specific files over: sudo cp /usr/local/Cellar/readline/7.0.3_1/lib/*.7.* /usr/local/opt/readline/lib/. It's messy, but it fixed it for me.

thanks, just need to brew reinstall readline

@arion
Copy link

arion commented Oct 18, 2019

Thanks ❤️

@blended-ideas
Copy link

Thank you, <3

@Awlter
Copy link

Awlter commented Mar 25, 2020

Had to do the same to link version 8
ln -s /usr/local/opt/readline/lib/libreadline.8.0.dylib /usr/local/opt/readline/lib/libreadline.7.dylib

Many thanks! 👍

Thanks, wondering what causes this

@brunitob
Copy link

brunitob commented Jun 9, 2020

Woked! for version 8

@Rfrixy
Copy link

Rfrixy commented Jun 10, 2020

Bless you

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