asmuth / recommendify

Generate recommendations using collaborative filtering
1.66k stars 146 forks source link

Can't install. Failed to build gem native extension. #8

Open egze opened 12 years ago

egze commented 12 years ago

I'm getting this error. Can you help?

Thanks

Installing recommendify (0.3.6) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/xxx/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb 

make
mkdir -p ../bin
gcc -Wall recommendify.c -lhiredis -o ../bin/recommendify
recommendify.c:4:29: error: hiredis/hiredis.h: No such file or directory
recommendify.c: In function ‘main’:
recommendify.c:20: error: ‘redisContext’ undeclared (first use in this function)
recommendify.c:20: error: (Each undeclared identifier is reported only once
recommendify.c:20: error: for each function it appears in.)
recommendify.c:20: error: ‘c’ undeclared (first use in this function)
recommendify.c:21: error: ‘redisReply’ undeclared (first use in this function)
recommendify.c:21: error: ‘all_items’ undeclared (first use in this function)
recommendify.c:22: error: ‘reply’ undeclared (first use in this function)
recommendify.c:83: warning: implicit declaration of function ‘redisConnectWithTimeout’
recommendify.c:92: warning: implicit declaration of function ‘redisCommand’
recommendify.c:100: warning: implicit declaration of function ‘freeReplyObject’
recommendify.c:111: error: ‘REDIS_REPLY_ARRAY’ undeclared (first use in this function)
recommendify.c:161: warning: implicit declaration of function ‘redisAppendCommand’
recommendify.c:162: warning: implicit declaration of function ‘redisGetReply’
make: *** [build] Error 1
asmuth commented 12 years ago

Hey Aleksandr,

the problem is the missing hiredis dependency. On OSX run:

brew install hiredis

and on Ubuntu:

apt-get install libhiredis-dev

on other platforms:

git clone https://github.com/antirez/hiredis.git && cd hiredis && make && sudo make install && sudo ldconfig

best regards :)

egze commented 12 years ago

Thanks a lot. Worked like a charm.

Can you add it to the README please so people don't get stuck like me? :)

tienle commented 12 years ago

:+1: update README