Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redis-linux/在linux上安装Redis时出错:`cc:未找到命令`_Linux_Redis - Fatal编程技术网

Redis-linux/在linux上安装Redis时出错:`cc:未找到命令`

Redis-linux/在linux上安装Redis时出错:`cc:未找到命令`,linux,redis,Linux,Redis,我希望在我的red hat环境中安装redis。我做了以下工作: wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make 我得到了下一个错误: make[3]: *** [net.o] Error 127 make[3]: Leaving directory `/tmp/redis-stable/deps/hiredis' make[2]: ***

我希望在我的red hat环境中安装redis。我做了以下工作:

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make 
我得到了下一个错误:

make[3]: *** [net.o] Error 127
make[3]: Leaving directory `/tmp/redis-stable/deps/hiredis'
make[2]: *** [hiredis] Error 2
make[2]: Leaving directory `/tmp/redis-stable/deps'
make[1]: [persist-settings] Error 2 (ignored)
    CC adlist.o
/bin/sh: cc: command not found
make[1]: *** [adlist.o] Error 127
make[1]: Leaving directory `/tmp/redis-stable/src'
make: *** [all] Error 2

如何修复它?

您正在尝试从源代码安装
redis
。这个过程要做的是在您的机器上编译和创建可执行文件,然后安装它。要做到这一点,您需要各种工具,如
gcc
等。最好的方法是通过安装该组将所有这些工具安装在一起。从终端运行这个

yum grouplist 
这将显示所有可用的组,然后选择要直接安装或运行的组

yum groupinstall 'Development Tools'

这将避免将来从源代码安装时可能出现的其他问题。

适用于遇到此错误的用户

在make之前,请运行此命令

$ cd deps; make hiredis lua jemalloc linenoise

从提取的
文件夹/Dir
中出来,用
rm-rf redis-x.x.x
删除提取的
redis-x.x
文件夹

现在再次使用
tar xzf redis-x.x.x.tar.gz


再次转到redis目录,然后再次运行make或make测试。它对我有用

首先安装build-essential

sudo-apt-get-install-build-essential

然后安装依赖项

cd部门

让hiredis lua jemalloc linenoise


如果您不是高级用户,从源代码安装REDIS可能不是一个好主意

相反,您应该安装一个打包版本。例如,在Fedora/Centos/RHEL上:

sudo yum install redis

它给出了以下错误:
设置组进程警告:组开发工具不存在。任何请求的组中都没有可用于安装或更新的包
@中间件您是否能够运行此
yum install gcc
。它会出现以下错误:
设置安装过程没有可用的包gcc。错误:无事可做
您的回购协议有问题。
yum repolist
的输出是什么。我有以下行:
rhel source Red Hat Enterprise Linux 6Server-x86_64-启用源代码:0
请将错误日志添加到帖子中,不要使用链接重定向我们。你在说什么?我把这个命令作为回答。只需在
make
之前运行命令,在我的情况下,我还需要
geohash int
如果您为我们所有人提供最少的代码,那就太好了,这样可以更好地在任何操作系统上复制。谢谢你的建议!