安装tmux但得到“ dyld:库未加载,引用自:/ usr /”


32

我尝试做

brew install tmux

它会安装,但是,可能是由于先前的失败并且没有完全删除,因此尝试使用tmux时,我尝试同时安装它和libevent并没有完全删除

$ tmux
dyld: Library not loaded: /usr/local/lib/libevent-2.0.5.dylib
  Referenced from: /usr/local/bin/tmux
  Reason: image not found
Trace/BPT trap: 5

我尝试安装libevent,但得到了:

$ brew install libevent
Warning: libevent-2.0.21 already installed, it's just not linked

所以我尝试了

$ brew link libevent

但是我得到了

Linking /usr/local/Cellar/libevent/2.0.21... 
Warning: Could not link libevent. Unlinking...
Error: Could not symlink file: /usr/local/Cellar/libevent/2.0.21/include/event2/util.h
Target /usr/local/include/event2/util.h already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
  brew link --overwrite formula_name
To list all files that would be deleted:
  brew link --overwrite --dry-run formula_name

所以我尝试了

$ brew link --overwrite libevent

但是我得到了

Linking /usr/local/Cellar/libevent/2.0.21... 
Warning: Could not link libevent. Unlinking...
Error: Permission denied - /usr/local/include/event2/util.h

所以我尝试了

$ sudo brew link --overwrite libevent

密码:

但是我得到了

Error: Cowardly refusing to `sudo brew link`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.

我被卡住了。

Answers:


19

我的也有同样的问题。

$ tmux
dyld: Library not loaded: /usr/local/lib/libevent-2.0.5.dylib
Referenced from: /usr/local/Cellar/tmux/1.9a/bin/tmux
Reason: image not found
Trace/BPT trap: 5

试图安装,libevent但已经存在,尚未链接:

$ brew install libevent
Warning: libevent-2.0.21 already installed
$ brew link libevent
Warning: Already linked: /usr/local/Cellar/libevent/2.0.21
To relink: brew unlink libevent && brew link libevent

我通过完全按照上面的建议解决了这个问题:

$ brew unlink libevent && brew link libevent
Unlinking /usr/local/Cellar/libevent/2.0.21... 4 links removed
Linking /usr/local/Cellar/libevent/2.0.21... 25 symlinks created
$ tmux -V
tmux 1.9a

5
那对我没用。我必须卸载并重新安装。
Kyle Heironimus'6


3

我的tmux最近也开始解决此错误。就我而言,简单地打电话brew upgrade tmux帮助了。


3

我在使用tmuxinator时遇到了同样的问题,在我用以下方法升级tmux的情况下遇到了该错误:

brew upgrade tmux 


0

我尝试了上述步骤,但是这些步骤对我没有用。就我而言,我只是没有缺少的libevent版本。我对它进行了两倍,三重检查,但似乎Brew或某种方式都无法提供该版本。

我所做的是libevent-2.1.6.dylib。我做了从libevent-2.0.5.dylib到上述文件的符号链接,而tmux似乎又能工作了。也许tmux应该更新?


1
我了解我似乎没有回答这个问题。我有完全相同的错误消息和症状。但是,我的问题不是链接不良的libevent,而是一个完全不同的版本。我的加入可以帮助其他人遇到与我同样的问题。
Kozie '17

@Tetsujin实际上,如果我们要分开头发,OP并没有真正提出问题。这个答案为我解决了这个问题,而又没有丢失tmux会话。感谢Kozie发布。
snapfractalpop

0

更新macOS后出现相同问题。解决

  • 如果您是tmux从源代码安装的,则要重新安装,它将链接新的libevent。
  • 如果使用自制程序运行 brew uninstall --force tmux; brew install tmux

0

我遇到了这个问题并尝试了上述解决方案,但没有成功。我发现,openssl有一个怪异的依赖关系,并且由于我通过pip它安装了openssl,因此未正确链接到/ usr / local / opt,并且通过brew链接也无法正常工作。一个简单的解决方案是通过brew卸载openssl和libevent并通过brew重新安装它们。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.