【问题标题】:OS X Yosemite ffi-hunspell dyld lazy symbol binding failed: symbol not foundOS X Yosemite ffi-hunspell dyld 惰性符号绑定失败:找不到符号
【发布时间】:2014-12-16 22:18:44
【问题描述】:

自从升级以来,我在运行测试时遇到了这个错误:

dyld: lazy symbol binding failed: Symbol not found: __ZN8HunspellC2EPKcS1_S1_
  Referenced from: /usr/lib/libhunspell-1.2.dylib
  Expected in: flat namespace

dyld: Symbol not found: __ZN8HunspellC2EPKcS1_S1_
  Referenced from: /usr/lib/libhunspell-1.2.dylib
  Expected in: flat namespace
  • 我已尝试重新安装 gem、全新 ruby​​ 安装、ruby 1.9.3 和 2.1.2
  • 它特定于系统 hunspell 版本,但我看不到如何在不编辑 ffi-hunspell gem 的情况下停止 ffi 加载
  • 我已经使用 xcode-select --install 安装了更新的 xcode 应用程序和命令行工具,它修复了 nokogiri 的一些问题,但没有解决这个问题

我认为这是 Apple 的 hunspell 1.2 版本的问题,因为 if I remove 1.2 from the ffi-hunspell gem(使用 bundle open ffi-hunspell)测试通过了,假设加载了我用自制软件安装的 hunspell 1.3。

有没有办法限制 ffi 查找库的位置?

另外,系统库是怎么回事?

【问题讨论】:

  • 不知道是不是这个问题,但是你升级到最新的 XCode 了吗?
  • 是的,并且再次执行 xcode-select --install 以获取命令行工具/库

标签: ruby macos ffi osx-yosemite dyld


【解决方案1】:
  1. 可选brew update
  2. brew install hunspell安装1.3版
  3. 将 gemfile 指向 gem 'ffi-hunspell', github: 'postmodern/ffi-hunspell'

它会停止加载系统库,不再报错。

【讨论】:

  • 此外,您可能必须运行brew update && brew upgrade,如此处所述:stackoverflow.com/a/22631734/308315 .. 这终于让它为我工作了。
  • 是的,这很好。 gem 已更新以尝试加载较新的版本,更新后的 homebrew 将在它尝试加载旧的和损坏的系统版本之前安装。
【解决方案2】:

在 ruby​​gems 发布比0.3.0 更新的版本之前,从 github 存储库捆绑 gem 应该可以解决此问题(This commit 包含修复,但由于某种原因尚未发布)。

gem 'ffi-hunspell', github: 'postmodern/ffi-hunspell'

您应该需要公开brew upgrade。首先尝试从 github 捆绑。

【讨论】:

    【解决方案3】:

    通常,在升级操作系统后,您必须为 gems 重新构建本机库。试试:

    gem pristine --all
    

    The documentation 解释它。

    【讨论】:

    • 虽然我很欣赏这个建议,但不幸的是它并没有解决问题。它也发生在新的 ruby​​ 安装 (rbenv) 上。
    猜你喜欢
    • 2011-12-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-18
    • 2016-04-19
    相关资源
    最近更新 更多