Mosh: dyld: 动态链接库未加载:/usr/local/lib/libprotobuf.7.dylib

6

我非常喜欢 mosh (http://mosh.mit.edu/),但在执行brew upgrade之后,它停止工作,并出现以下错误。

> mosh example.com
dyld: Library not loaded: /usr/local/lib/libprotobuf.7.dylib
  Referenced from: /usr/local/bin/mosh-client
  Reason: image not found
Died at /usr/local/bin/mosh line 201. 
4个回答

7
在一些调查后,我意识到这是由于 protobuf 被升级了,并且 mosh 是硬编码使用 protobuf 2.4.1 导致的。
所以我所要做的就是将 protobuf 2.5.0 回滚到 2.4.1。在 Mac 上使用 homebrew 可以按照以下步骤完成:
> brew versions protobuf
2.5.0    git checkout 019364d /usr/local/Library/Formula/protobuf.rb
2.4.1    git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> git checkout 544209f /usr/local/Library/Formula/protobuf.rb
> brew unlink protobuf
> brew link protobuf

我在Yosemite上无法构建2.4.1,但2.5.0似乎也可以正常工作。 - Maciej Swic

5

1
你可以先更新brew,然后升级mosh到1.2.4版本:
$ brew update

...

$ brew upgrade mobile-shell
==> Upgrading 1 outdated package, with result:
mobile-shell 1.2.4
==> Upgrading mobile-shell
==> Downloading http://mosh.mit.edu/mosh-1.2.4.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/mobile-shell/1.2.4
==> make install
  /usr/local/Cellar/mobile-shell/1.2.4: 12 files, 1004K, built in 41 seconds   

0

我也遇到了同样的问题,下一行代码帮助了我:

brew reinstall protobuf

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接