Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: hiredis/hiredis.h: No such file or directory #6

Closed
gedankenstuecke opened this issue Mar 14, 2012 · 6 comments
Closed

error: hiredis/hiredis.h: No such file or directory #6

gedankenstuecke opened this issue Mar 14, 2012 · 6 comments

Comments

@gedankenstuecke
Copy link

Hi,
I just tried to install recommendify on my machine but gem install always fails with the errors below during the build of the native extension. I tried to install on Mac OS 10.7, Archlinux and Debian and had no luck. So it seems to be an error on the end of the gem. ;-)

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
Copy link
Owner

asmuth commented Mar 14, 2012

Hey,

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 :)

@gedankenstuecke
Copy link
Author

Thanks a lot. I somehow missed that having redis alone isn't enough. It now works for me, thanks a lot. :)

@thebyrd
Copy link

thebyrd commented Jun 19, 2012

Paas Providers like Heroku don't allow you to install extra libraries. Is there a way to include all dependencies in the gem file?

@ddgromit
Copy link

@thebyrd I figured out how to get recommendify to work with Heroku. Super late, but hopefully maybe this can help anyone else with the same problem.

This guy has forked recommendify to compile the libraries it needs as part of the gem install process:
https://github.com/danmorin/recommendify/tree/native

Use this in your gemfile, bundle install and redeploy:

gem 'recommendify', git: "https://github.com/danmorin/recommendify.git", branch: "native"

@evandrix
Copy link

evandrix commented Dec 4, 2014

fyi: The repository @ github.com/antirez/hiredis.git is now @ github.com/redis/hiredis.git

@shubhagrwl
Copy link

shubhagrwl commented Jun 24, 2019

To install hiredis on centos (yum install -y hiredis)

  1. git clone http://github.com/redis/hiredis
  2. sudo make
  3. sudo make install
  4. sudo ldconfig

Still got an error (error while loading shared libraries: libhiredis.so.0.15: cannot open shared object file: No such file or directory) then do,

  • sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf
  • sudo ldconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants