如果我的(zsh)shell每次打开终端时都会向我抛出这些错误/警告,这意味着什么?

时间:2015-01-24 10:56:37

标签: macos shell unix zsh

这是我每次启动Terminal.app时看到的,因为我从Mavericks升级到Yosemite:

dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
  Referenced from: /usr/local/bin/zsh
  Reason: image not found
zsh: trace trap
/Users/user/sandbox/repos/zsh-notify/notify.plugin.zsh:55: command not found: add-zsh-hook
/Users/user/sandbox/repos/zsh-notify/notify.plugin.zsh:56: command not found: add-zsh-hook

要查看权限是否可能搞砸了,我检查了

➜  exp-scotty  where zsh
/usr/local/bin/zsh
/usr/local/bin/zsh
/bin/zsh
/bin/zsh
➜  exp-scotty  ll `where zsh`
-rwxr-xr-x  1 root   wheel   538K Sep 10 01:19 /bin/zsh
-rwxr-xr-x  1 root   wheel   538K Sep 10 01:19 /bin/zsh
lrwxr-xr-x  1 milan  admin    27B Oct 28 10:59 /usr/local/bin/zsh -> ../Cellar/zsh/5.0.7/bin/zsh
lrwxr-xr-x  1 milan  admin    27B Oct 28 10:59 /usr/local/bin/zsh -> ../Cellar/zsh/5.0.7/bin/zsh

版本:

➜  exp-scotty  sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.1
BuildVersion:   14B25

➜  exp-scotty  /bin/zsh --version
zsh 5.0.5 (x86_64-apple-darwin14.0)

➜  exp-scotty  /usr/local/bin/zsh --version
dyld: Library not loaded: /usr/local/lib/libpcre.1.dylib
  Referenced from: /usr/local/bin/zsh
  Reason: image not found
[1]    81495 trace trap  /usr/local/bin/zsh --version

可能出现什么问题?和/或我该如何解决?

1 个答案:

答案 0 :(得分:4)

这意味着您正在尝试使用add-zsh-hook而不加载它。您的shell配置缺少autoload -U add-zsh-hook。除此之外,如果您使用libpcre,则错过了brew,您可能需要重新安装并重新链接。