redis / hiredis-rb

Ruby wrapper for hiredis
BSD 3-Clause "New" or "Revised" License
320 stars 90 forks source link

Failed to build gem native extension #1

Closed EppO closed 13 years ago

EppO commented 13 years ago

On Mac OSX 10.6.7, using hiredis 0.10 (installed through homebrew), when I try to install hiredis-rb through rubygems 1.6.2 (w/ ruby 1.9.2), I get this error :

/Users/eppo/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-hiredis-lib=/usr/local/lib --with-hiredis-include=/usr/local/include/hiredis
checking for hiredis.h... yes
checking for redisReplyReaderCreate() in -lhiredis... no

I added manually --with-hiredis-lib and --with-hiredis-include parameters but I got the same error without too. My hiredis setup seems correct though:

# ll /usr/local/lib/libhiredis.* /usr/local/include/hiredis/
lrwxr-xr-x  1 eppo  staff  41 16 mai 21:41 /usr/local/lib/libhiredis.a -> ../Cellar/hiredis/0.10.0/lib/libhiredis.a
lrwxr-xr-x  1 eppo  staff  45 16 mai 21:41 /usr/local/lib/libhiredis.dylib -> ../Cellar/hiredis/0.10.0/lib/libhiredis.dylib

/usr/local/include/hiredis/:
total 40
drwxr-xr-x  5 eppo  staff   170 22 avr 06:15 adapters
-rw-r--r--  1 eppo  staff  4916 22 avr 06:15 async.h
-rw-r--r--  1 eppo  staff  8703 22 avr 06:15 hiredis.h

I checked in hiredis.h I have in /usr/local/include/hiredis/hiredis.h and redisReplyReaderCreate is present.

pietern commented 13 years ago

Thanks for the report. This issue was caused by extconf.rb (which is used to create a Makefile) that doesn't prefer the bundled library over the installed libraries in the system-wide library dirs. This means that hiredis-rb was always trying to link against the version that you installed with homebrew, which was (until just now) not yet compatible with hiredis-rb. Some function symbols changed in hiredis itself which in turn caused the build process of hiredis-rb to flunk. I've updated hiredis-rb (and bumped the version to 0.3.2) to make sure it always links to the bundled version. If you only use hiredis for hiredis-rb, you can safely remove it from homebrew since hiredis-rb is 100% self-contained.

Cheers, Pieter

EppO commented 13 years ago

great responsiveness ! will try it ASAP, thanks Pieter

cheers

EppO commented 13 years ago

Works great ! thanks again.

pietern commented 13 years ago

No problem!