knz
knz

Reputation: 499

Error loading library in mac terminal

Anyone please help..
How can I fix the following error:

dyld: Library not loaded: /usr/local/lib/libgdbm.4.dylib  
  Referenced from: /usr/local/bin/zsh  
  Reason: image not found  

Upvotes: 49

Views: 16149

Answers (9)

Shrm
Shrm

Reputation: 453

This error is raised from "ncurses"

If you are using OSX without any system manager like Conda, try:

brew reinstall ncurses

If you are using Conda, activate your environment and try this:

conda install -y conda-forge::ncurses

Goodluck

Upvotes: 1

Grenoblois
Grenoblois

Reputation: 559

execute this command

   chsh -s /bin/zsh                   

Upvotes: 0

Rajan Sharma
Rajan Sharma

Reputation: 25

If you facing the issue in iTerm2. You can simply change the path of your shell. Just go to iTerm2>>Preferences>>profile>>General>>command

Click on the dropdown and select Command and enter the command

/bin/zsh

This worked for me

Upvotes: 0

Andreas Bigger
Andreas Bigger

Reputation: 5540

After searching for a long time, this solved it for me:

brew reinstall ncurses

Upvotes: 4

Igal Katzir
Igal Katzir

Reputation: 1

I had the same issue and did not have an option to change the terminal on startup.

I ended up doing the following steps to resolve the problem:

  1. Create a new user on my mac & enable remote login for him.

  2. Login with the new user, which got a new working shell.

  3. Changing the shell of my original account back to bash, using the chsh command.

  4. Upgrading zsh using brew.

It Worked!

Upvotes: 0

De_Vano
De_Vano

Reputation: 1404

Simple reinstall zsh will help you:

brew reinstall zsh && brew unlink zsh && brew link zsh

Alternatively you can try to upgrade zsh

brew upgrade zsh

Upvotes: 121

coderuby
coderuby

Reputation: 1208

To be able to fix my terminal/iterm2/hyper (all were broke because of broken zsh) I had to first change my terminal settings 'Shells open with' from a custom command to the default login shell.

enter image description here

Without these changes, I could not type anything in terminal and iterm2 and hyper were crashing immediately after start.

With these changes, I was able to update my zsh via homebrew as suggested in the other answers by De_Vano and C.Nivs and all three apps worked as expected again. In my case a simple upgrade of zsh was enough. No need to reinstall and unlink.

Upvotes: 8

C.Nivs
C.Nivs

Reputation: 13106

Late to the party on this one, but simply running

brew upgrade zsh

solved my issue on MacOS High Sierra. Trying to uninstall gdbm will throw dependency errors against zsh and python, and re-doing the symlinks didn't solve for me, either

Upvotes: 42

Sergio
Sergio

Reputation: 303

I suspect you are running into problems while working with Homebrew on MacOSX. I am actually saying this because I have just run into the exact same situation.

The problem comes after upgrading my MacOSX version to Maverick from Mountain Lion while having already installed Homebrew (of course this may apply to previous and future upgrades). After the upgrade you will need also:

  • Reinstall the XCode tools
  • Run an update on Homebrew

    brew update

  • Run a general upgrade of your Homebrew packages

    brew upgrade

  • Make sure you do not have any other problems on your installation

    brew doctor

Finally you may find that certain packages are failing due to missing libraries, which seems to be the case you are describing. The idea here is to reinstall the library missing using the brew command.

In your case you would need to reinstall the gdbm library by performing the next steps on your terminal:

brew uninstall gdbm
brew install gdbm

That should fix it.

Upvotes: 8

Related Questions