Quintus/ruby-xz

can't require 'xz' on OS X without adding a symlink

Closed this issue · 0 comments

I am on OS X 10.11.3 using the system ruby and got the following error when I tried to require the ruby-xz gem:

$ irb -rxz
/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/lib/ffi/library.rb:133:in `block in ffi_lib':LoadError: Could not open library 'lzma.so.5': dlopen(lzma.so.5, 5): image not found.
Could not open library 'liblzma.so.5.dylib': dlopen(liblzma.so.5.dylib, 5): image not found.
Could not open library 'lzma.so': dlopen(lzma.so, 5): image not found.
Could not open library 'liblzma.so.dylib': dlopen(liblzma.so.dylib, 5): image not found.
Could not open library 'lzma': dlopen(lzma, 5): image not found.
Could not open library 'liblzma.dylib': dlopen(liblzma.dylib, 5): image not found

The following files exist:

/usr/lib/liblzma.5.dylib
/usr/lib/liblzma.dylib -> liblzma.5.dylib

I symlinked liblzma.dylib as /usr/local/lib/liblzma.so.dylib and things work then as expected... You may want to add liblzma.5.dylib and/or liblzma.dylib to the search list since that seems to be how they are named on OS X now.