运行make命令时,在RHEL上安装Redis失败。下面是输出
cd src && make all
make[1]: Entering directory `/root/Downloads/redis-3.2.0/src'
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/Downloads/redis-3.2.0/src'
make: *** [all] Error 2发布于 2016-05-11 02:57:05
正在运行
make distclean然后
make解决了问题
发布于 2018-12-30 02:35:43
发生这种情况是因为机器上没有可用的gcc编译器。首先安装gcc:
$ sudo apt install gcc然后试一试
make当然,它会解决这个问题。我在ubuntu 18.04上试过。
发布于 2016-08-30 19:35:02
Redis只有在目录hiredis lua jemalloc linenoise中的依赖项被解析之后,才会创建redis服务器和hiredis-cli文件。我不得不在deps目录中多次运行make命令来解析依赖关系。
以下是我遵循的步骤:
cd <redisInstallationPath> (I have it under /opt/mount1/redis-3.0.7)
make distclean
cd deps/多次解析依赖项。
make lua hiredis linenoise
make jemalloc
make hiredis
make linenoise再次执行相同的操作,因为有几个文件丢失。我认为你只需要正确的组合就可以了。多次运行make命令,直到正确为止。
make hiredis lua jemalloc linenoise
make hiredis
make lua
make jemalloc
make linenoise
cd /opt/mount1/redis-3.0.7/
make->我在这里收到一些错误,文件hiredis/libhiredis.a找不到,因此我再次继续解析依赖项。
cd deps
make jemalloc
make hiredisll hiredis/libhiredis.a ->生成一个文件
cd /opt/mount1/redis-3.0.7/
make现在我得到以下输出:
cd src && make all
make[1]: Entering directory `/opt/mount1/redis-3.0.7/src'
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/opt/mount1/redis-3.0.7/src'您可以进入Redis安装路径(我的安装路径是: /opt/mount1/redis-3.0.7目录)来启动服务器。
src/redis-server在另一个终端上运行' Redis -cli‘来连接到Redis服务器。
src/redis-cli示例:
127.0.0.1:6379> incr counter
(integer) 1
127.0.0.1:6379> get counter
"1"
127.0.0.1:6379> exit我通过这篇文章http://michael.otacoo.com/redis/redis-first-steps-fetch-install-and-server-creation/得到了我的问题的解决方案
https://stackoverflow.com/questions/37103054
复制相似问题