2

Since upgrading I've been getting this error when running my tests:

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
  • I've tried reinstalling the gem, fresh ruby install, ruby 1.9.3 and 2.1.2
  • It's specific to the system hunspell version, but I can't see how to stop ffi loading that without editing the ffi-hunspell gem
  • I've installed the updated xcode app and command line tools with xcode-select --install, which fixed some problems with nokogiri but not with this

I think it's an issue with Apple's hunspell 1.2 build, as if I remove 1.2 from the ffi-hunspell gem (with bundle open ffi-hunspell) the tests pass, assumedly loading the hunspell 1.3 I've installed with homebrew.

Is there a way to restrict where ffi looks for libraries?

Also, what's up with the system library?

nruth
  • 1,068
  • 7
  • 22

3 Answers3

3
  1. optionally brew update
  2. brew install hunspell to install a version 1.3
  3. Point your gemfile at gem 'ffi-hunspell', github: 'postmodern/ffi-hunspell'

It will stop loading the system library, and no more errors.

nruth
  • 1,068
  • 7
  • 22
  • 1
    Additionally, you may have to run `brew update && brew upgrade` as mentioned here: http://stackoverflow.com/a/22631734/308315 .. This finally got it working for me. – iwasrobbed Oct 27 '14 at 20:30
  • Yes that's a good point. The gem was updated to try to load the newer version, which updated homebrew will install, before it tries to load the older and broken system version. – nruth Dec 17 '14 at 15:12
1

Bundling the gem from the github repo should fix this until a version newer than 0.3.0 is released to rubygems (This commit contains a fix, but has not been released for some reason).

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

You should not need to do a wide open brew upgrade. Try bundling from github first.

bimbom22
  • 4,510
  • 2
  • 31
  • 46
-1

Often, after upgrading the OS, you'll have to rebuild your native libraries for gems. Try:

gem pristine --all

The documentation explains it.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
  • While I appreciate the suggestion, unfortunately it's not fixing the problem. It's also occurring on a fresh ruby install (rbenv). – nruth Oct 21 '14 at 22:19