I got this error whenever I tried to run bash after brew updating to 4.3.30:
dyld: Library not loaded: @@HOMEBREW_PREFIX@@/opt/readline/lib/libreadline.6.dylib
Referenced from: /usr/local/Cellar/bash/4.3.30/bin/./bash
Reason: image not found
Trace/BPT trap: 5
I had to roll back to an earlier version.
Sorry but you have not followed the requested steps on the Troubleshooting page: https://github.com/Homebrew/homebrew/wiki/Troubleshooting
Please follow (all of) these steps and post the information here so we can help you with your problem.
OK, brew config is:
Last commit: 3 hours ago
CPU: 8-core 64-bit haswell
OS X: 10.9.5-x86_64
Clang: 6.0 build 600
System Ruby: 2.0.0-481
and brew doctor reports:
Warning: You have MacPorts or Fink installed:
This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.
sudo mv /opt/local ~/macports
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install openssl
Run `brew missing` for more details.
brew gist-logs bash says Error: No logs.
brew gist-logs bash
Error: No logs.
Previous issue on this same root cause discussed in #32893.
brew reinstall bash
"brew reinstall bash" will not fix the problem
the issue is not bash itself, it has dependencies on readline and your readline lib is the wrong version
I've removed brew's bash and have applied Apple's security update instead.