dyld:未加载库:/usr/local/lib/liblua.5.1.5.dylib

时间:2014-11-27 14:13:07

标签: macos lua homebrew

尝试调用终端Vim(来自MacVim目录的终端应用程序)时出现以下错误;在我更新homebrewrvm&重新安装了新版Ruby

dyld: Library not loaded: /usr/local/lib/liblua.5.1.5.dylib
  Referenced from: /Applications/MacVim.app/Contents/MacOS/Vim
  Reason: image not found

注意:能够解决它,所以我想如果有人在同一个问题上绊倒我会记录。

8 个答案:

答案 0 :(得分:5)

问题似乎是因为homebrew以某种方式删除了lua运行所需的旧版Vim

所以从homebrew安装了特定版本,如下所示:

  1. homebrew搜索可用的公式:brew search lua;得到了:

    lua lua51 luabind luajit luarocks homebrew/nginx/lua-nginx-module

  2. 已安装:brew install lua51
  3. 这解决了这个问题。我发布它可能能够解决与安装不同版本的软件包相关的其他brew相关问题。

答案 1 :(得分:5)

我使用自制软件安装的vim,我的解决方案是重新安装vim

运行 brew reinstall vim

答案 2 :(得分:3)

我有类似的信息:

dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib

切换版本对我有帮助:

$ brew switch lua 5.2.1
    Error: lua does not have a version "5.2.1" in the Cellar.
    Versions available: 5.2.4_1, 5.2.4_3, 5.2.4_4, 5.3.4_2
$ brew switch lua 5.2.4_4
    Cleaning /usr/local/Cellar/lua/5.3.4_2
    Cleaning /usr/local/Cellar/lua/5.2.4_3
    Cleaning /usr/local/Cellar/lua/5.2.4_4
    Cleaning /usr/local/Cellar/lua/5.2.4_1
    71 links created for /usr/local/Cellar/lua/5.2.4_4

答案 3 :(得分:1)

错误:

dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib
  Referenced from: /usr/local/bin/vim
  Reason: image not found
[1]    30835 abort      vim

尝试:

brew switch lua 5.2

错误:

Error: lua does not have a version "5.2" in the Cellar.
Versions available: 5.2.4_4, 5.3.4_2

解决方案:

brew switch lua 5.2.4_4

VIM正常运行

答案 4 :(得分:0)

尝试运行:

brew link lua

看看是否有效。

可替换地:

brew link --overwrite lua

答案 5 :(得分:0)

➜ sudo vi
dyld: Library not loaded: /usr/local/opt/lua/lib/liblua.5.2.dylib
  Referenced from: /usr/local/bin/vi
  Reason: image not found
[1]    29504 abort      sudo vi

这是因为Vim运行所需的旧版本的lua。

brew switch lua 5.2.4_4

答案 6 :(得分:0)

我按照以下步骤,没问题。

<块引用>
  1. brew 卸载 vim
  2. brew install v

答案 7 :(得分:0)

如果您的问题是由于 vi 无法作为编辑器被找到。出现这样的错误:

dyld: Library not loaded: /usr/local/opt/ruby/lib/libruby.2.7.dylib
Referenced from: /usr/local/bin/vi
Reason: image not found
error: vi died of signal 6
error: There was a problem with the editor 'vi'.

可以通过将Git的编辑器设置为vim来解决:

git config --global core.editor $(which vim)

Here's the discussion 在这里我得到了这个案例的解决方案。