【问题标题】:Redis make failing. Ubuntu 18.04Redis 会失败。 Ubuntu 18.04
【发布时间】:2020-08-27 07:35:50
【问题描述】:

我正在尝试make Redis 6.0.6.,但是在运行 make 命令时出现此错误:

(.venv) vagrant@vagrant:/vagrant/redis-6.0.6$ make
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
/bin/sh: 1: pkg-config: not found
    CC Makefile.dep
/bin/sh: 1: pkg-config: not found
make[1]: Warning: File 'Makefile.dep' has modification time 1.3 s in the future
    CC adlist.o
/bin/sh: 1: cc: not found
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

安装 pkg-config 后,我现在得到一个不同的错误:

(.venv) vagrant@vagrant:/vagrant/redis-6.0.6$ make
cd src && make all
make[1]: Entering directory '/vagrant/redis-6.0.6/src'
    CC Makefile.dep
make[1]: Warning: File 'Makefile.dep' has modification time 1.4 s in the future
    CC adlist.o
In file included from adlist.c:34:0:
zmalloc.h:50:10: fatal error: jemalloc/jemalloc.h: No such file or directory
 #include <jemalloc/jemalloc.h>
          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Makefile:315: recipe for target 'adlist.o' failed
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory '/vagrant/redis-6.0.6/src'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2

编辑: 安装tcl后运行redis-test出错:

Testing integration/replication-2
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 21111
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4452.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4452.1/socket
ERROR:4484:C 28 Aug 2020 06:28:05.075 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4484:C 28 Aug 2020 06:28:05.076 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4484, just started
4484:C 28 Aug 2020 06:28:05.076 # Configuration loaded
4484:M 28 Aug 2020 06:28:05.084 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4484:M 28 Aug 2020 06:28:05.134 # Opening Unix socket: bind: Operation not permitted
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 27111
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4464.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4464.1/socket
ERROR:4506:C 28 Aug 2020 06:28:05.074 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4506:C 28 Aug 2020 06:28:05.075 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4506, just started
4506:C 28 Aug 2020 06:28:05.075 # Configuration loaded
4506:M 28 Aug 2020 06:28:05.076 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4506:M 28 Aug 2020 06:28:05.126 # Opening Unix socket: bind: Operation not permitted
[12/56 done]: unit/printver (132 seconds)
Testing integration/replication-3
[13/56 done]: unit/type/zset (132 seconds)
Testing integration/replication-4
[err]: Can't start the Redis server
CONFIGURATION:always-show-logo yes
notify-keyspace-events KEA
daemonize no
pidfile /var/run/redis.pid
port 22611
timeout 0
bind 127.0.0.1
loglevel verbose
logfile ''
databases 16
latency-monitor-threshold 1
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir ./tests/tmp/server.4455.1
slave-serve-stale-data yes
appendonly no
appendfsync everysec
no-appendfsync-on-rewrite no
activerehashing yes
unixsocket /vagrant/redis-6.0.6/tests/tmp/server.4455.1/socket
ERROR:4493:C 28 Aug 2020 06:28:05.061 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
4493:C 28 Aug 2020 06:28:05.062 # Redis version=6.0.6, bits=64, commit=00000000, modified=0, pid=4493, just started
4493:C 28 Aug 2020 06:28:05.063 # Configuration loaded
4493:M 28 Aug 2020 06:28:05.067 * Increased maximum number of open files to 10032 (it was originally set to 1024).
4493:M 28 Aug 2020 06:28:05.080 # Opening Unix socket: bind: Operation not permitted

【问题讨论】:

    标签: redis vagrant redis-server


    【解决方案1】:

    安装pkg-config 后,建议执行全新安装。

    rm -rf redis-6.0.6
    tar xvzf redis-6.0.6.tar.gz
    cd redis-6.0.6/
    make
    

    【讨论】:

    • 它做得更多,但仍然出现与以前相同的致命错误
    • 好的,设法使用stackoverflow.com/questions/47088171/… 这个答案修复了该错误,但我收到警告说构建可能不完整,这似乎是真的,因为 make test 失败并且 redis-server 是无效的命令
    • 你可以试试make distclean,然后再试试make
    • 好的,可以,还从错误中读取,而不是我需要更新版本的 tcl
    • 我在安装 tcl 后添加了一个新错误,将尝试进行 distclean。
    【解决方案2】:

    在我的情况下,我没有在我的 Ubuntu 上安装 gcc,使用“sudo apt install gcc”安装它为我修复了它。 安装 gcc,运行命令“make distclean”然后运行“make

    【讨论】:

      【解决方案3】:

      我在 WSL 中遇到了同样的问题,对我有用的是:

      sudo apt-get install -y pkg-config
      sudo apt-get update
      sudo apt install gcc
      sudo apt-get install tcl
      sudo make distclean
      sudo make
      

      希望这会有所帮助。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-10
        • 2019-08-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-02-11
        相关资源
        最近更新 更多