mac : Referenced from: /usr/local/bin/zsh

  1.  mac 系统升级后,终端坏了,瘫痪了一天
  2. 每次打开终端都提示:

    Last login: Fri Jun 10 23:23:25 on ttys000

    dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib

      Referenced from: /usr/local/bin/zsh

      Reason: image not found

    [Process completed]

  3.  终端不能用,想重装,卸载都不行
  4. 后来根据链接[1],可以更改默认shell模式
  5. 将/usr/local/bin/zsh  改成 /bin/zsh

 

猜测原因: 在执行 brew update 后,zsh 被更改了

 

 

参考:

[1]http://osxdaily.com/2012/03/21/change-shell-mac-os-x/     [重要]

 

 

mac : brew error

  1.  错误log

✘ saiwei@saiwei-mac  ~  brew update
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file — mach (LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’
from /usr/local/Library/Homebrew/extend/pathname.rb:2:in `<top (required)>’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’
from /usr/local/Library/Homebrew/global.rb:3:in `<top (required)>’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’

解决方法:

Thanks, everyone. For future reference, the fix for me was:

sudo chown -R $(whoami):admin /usr/local
cd $(brew --prefix) && git fetch origin && git reset --hard origin/master

then I could

brew update

参考:https://github.com/Homebrew/legacy-homebrew/issues/49879