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

Trouble installing and configuring Redis #54

Closed
wlandau opened this issue May 18, 2022 · 2 comments
Closed

Trouble installing and configuring Redis #54

wlandau opened this issue May 18, 2022 · 2 comments

Comments

@wlandau
Copy link

wlandau commented May 18, 2022

On a Mac, after I install hiredis through homebrew (version 1.0.2) and then install the redux CRAN binary, redis_available() returns FALSE. When I attempt to compile the GitHub version, I see:

* installing *source* packageredux...
** using staged installation
Homebrew 3.4.11
Homebrew/homebrew-core (git revision bc67f7dc398; last commit 2022-05-18)
Homebrew/homebrew-cask (git revision 9b19988b51; last commit 2022-05-18)
Using PKG_CFLAGS=-I/usr/local/opt/hiredis/include
Using PKG_LIBS=-L/usr/local/opt/hiredis/lib -lhiredis
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because hiredis was not found. Try installing:
 * deb: libhiredis-dev (Debian, Ubuntu, etc)
 * rpm: hiredis-devel (Fedora, EPEL)
 * brew: hiredis (OSX)
If hiredis is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a hiredis.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------

I am not sure what to set for INCLUDE_DIR or LIB_DIR.

@richfitz
Copy link
Owner

I don't use homebrew on my macs, but the script included there generally works fine for most people, and I am not sure why it would not behave there. If you've not installed hiredis the "autobrew" pulls down the required lib. The CRAN mac version should not require compilation at all, and does not depend on anything installed locally as it statically links the hiredis library.

It's possible that you are mixing two things up though. The redux package includes only the client and redux::redis_available() will return FALSE unless you also have a redis server available. There's docs for possible options in the rrq docs. We typically use docker to manage this - you can do

docker run -d --name redis-test -p 127.0.0.1:6379:6379 redis

to bring up a server. In the past I've also installed it directly onto my machine, but rarely do that now (https://redis.io/docs/getting-started/)

@wlandau
Copy link
Author

wlandau commented May 20, 2022

Thanks, Rich. https://redis.io/docs/getting-started/ helped me figure it out. Turns out I needed brew install redis (I only ran brew install hiredis before). Then, redux::redis_available() returned TRUE when a redis-server process was actively running. Makes sense in hindsight.

@wlandau wlandau closed this as completed May 20, 2022
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

2 participants