Closed nruth closed 10 years ago
You need to recompile any code that was compiled previous (by you or homebrew) after an upgrade.
I have tried reinstalling the gem and hunspell but get the same error. According to the mesage it's using a system library (1.2) instead of the one from homebrew (1.3). I uninstalled the homebrew ffi and hunspell, reinstalled the gem, and again the same error. I've switched to the non-ffi gem for now just to get around the problem but would be interested to know if others have been able to get it to work since the update from a clean install or upgrade.
The gem only contains pure-ruby FFI bindings to libhunspell. Sounds like you need to re-install or upgrade the system's hunspell library.
OK good to know. I'll stick to s/o and rebuilding things. Thanks for the help :)
Out of curiosity I changed https://github.com/postmodern/ffi-hunspell/blob/master/lib/ffi/hunspell/hunspell.rb#L7
from
ffi_lib ['hunspell-1.2', 'libhunspell-1.2.so.0',
'hunspell-1.3', 'libhunspell-1.3.so.0']
to
ffi_lib [
'hunspell-1.3', 'libhunspell-1.3.so.0']
and my tests passed, assumedly finding the hunspell 1.3 I've installed with brew instead of using the Mac OS one that's somehow broken / incompatible.
It also works with the order reversed:
ffi_lib ['hunspell-1.3', 'libhunspell-1.3.so.0',
'hunspell-1.2', 'libhunspell-1.2.so.0']
Is there a way to specify which library (or path) is used?
I believe $LD_LIBRARY_PATH
should work on OSX.
I had a quick go with that and no luck, but the commit you just made gets around the problem so I'm going to go with that and stop working on this. Thanks again!
I ended up having to run brew update && brew upgrade
before this would work.
Also, you can try copying the 1.3.x lib files from the Homebrew folders to the usr/lib
directory.
I ran into this problem as well and solved it by pointing my Gemfile at this github repo.
gem "ffi-hunspell", github: "postmodern/ffi-hunspell"
It looks like this was fixed with this commit (9151663), but the update has not been pushed out to rubygems. Any particular reason why not? That commit was about ten months ago.
You shouldn't need to run a wide-open brew upgrade
. That's super heavy-handed.
@postmodern it's been about 15 months since this was fixed in 9151663, and it still has not made it into a distributed release.
People are doing crazy things like brew update && brew upgrade
trying to work around this, not realizing that it was fixed but never released.
Do you have any plans to push an updated release to rubygems so we don't have to continue bundling from the github repo? Is there any reason not to?
Oops, this slipped through the cracks. Released 0.3.1 after manually testing since TravisCI is lagging.
@postmodern Thank you, thank you! 🚀
I got a similar error message, but then realized that homebrew installed version 1.4.1 of hunspell. Noting this here in case anyone else experiences the same issue.
➜ ~ brew info hunspell
hunspell: stable 1.4.1 (bottled)
Spell checker and morphological analyzer
Edit - I'm assuming 1.4.1 isn't in the search path, and so 1.2.x is likely being loaded from the system.
I've opened a PR to fix the 1.4.1 issue above - https://github.com/postmodern/ffi-hunspell/pull/14
All the tests run fine and this fixed the issue on my local development environment, and my tests run on a linux jenkins instance still using hunspell 1.3 so hopefully it's a non-controversial change.
Posted at http://stackoverflow.com/questions/26490964/os-x-yosemite-ffi-hunspell-dyld-lazy-symbol-binding-failed-symbol-not-found in case it's not a gem issue
Since upgrading I've been getting this error when running my tests:
Is there something in the gem related to this, or is it a system specific problem? Has anyone else encountered this or fixed it?