macos 有没有更新redis的命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8566213/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a command to update redis?
提问by elliottregan
I'm working on the front end for a web app, but I'm trying to learn as much of the backend setup as I can as well. I am setting up redis on a new computer myself, but running into a few hiccups.
我正在开发 Web 应用程序的前端,但我也在尽可能多地学习后端设置。我自己正在一台新计算机上设置 redis,但遇到了一些小问题。
The wget command cannot be found, so I assume it Linux only? I am following these instructionsto install redis on Mac OS 10.7. I have redis 2.0.0 installed, but while attempting to install 2.4.4 using the same commands, I am told redis-server, redis-cli, redis-benchmark cannot be found, and I can't copy them to /usr/local/bin.
找不到 wget 命令,所以我认为它只是 Linux?我正在按照这些说明在 Mac OS 10.7 上安装 redis。我已经安装了 redis 2.0.0,但是在尝试使用相同的命令安装 2.4.4 时,我被告知找不到 redis-server、redis-cli、redis-benchmark,我无法将它们复制到 /usr/本地/垃圾箱。
I could not find an update command to bring redis up to the most recent version. I don't think it should be this difficult to install the most recent version on redis on Mac OS, but I can't see what I am doing wrong.
我找不到将 redis 升级到最新版本的更新命令。我认为在 Mac OS 上的 redis 上安装最新版本应该不难,但我看不出我做错了什么。
回答by Nick Coelius
So far as I know, typing:
据我所知,输入:
$ brew upgrade redis
should work, where $ indicates your command line. If it complains about HomeBrew not being installed, you can obtain that here. Brew is an excellent package manager, and a great way of taking care of your files.
应该可以工作,其中 $ 表示您的命令行。如果它抱怨 HomeBrew 没有安装,你可以在这里获得。Brew 是一个出色的包管理器,也是管理文件的好方法。
回答by Ghost_141
It would be better to follow this way.
最好遵循这种方式。
$ brew update
$ brew update
$brew upgrade redis
$brew upgrade redis
回答by Julian Soro
If you're not using brew, then these steps will help you get up to date.
如果您不使用 brew,那么这些步骤将帮助您了解最新情况。
First, find the location of your installed redis-server instance before updating. In my case, it was in /usr/local/bin/
, but it might also be in /usr/bin/
. If it's not here, you can type which redis-server
to find the location.
首先,在更新之前找到您安装的 redis-server 实例的位置。就我而言,它在 中/usr/local/bin/
,但也可能在/usr/bin/
. 如果它不在这里,您可以键入which redis-server
以查找位置。
Next, download the redis tar file from https://redis.io/download, then install it from the directory it downloaded to:
接下来,从https://redis.io/download下载 redis tar 文件,然后从它下载到的目录中安装它:
cd Downloads
tar xzf redis-X.Y.Z.tar.gz
cd redis-X.Y.Z
make test
make
Next, we'll move the new installed redis to the location where the current instance is running:
接下来,我们将新安装的 redis 移动到当前实例运行的位置:
sudo mv src/redis-server /usr/local/bin
sudo mv src/redis-cli /usr/local/bin
Now you should be ready to use redis-server and redis-cli in the new version.
现在您应该准备好在新版本中使用 redis-server 和 redis-cli。
PS - I also moved the redis-benchmark, redis-sentinel, redis-check-aof, and redis-check-dump files because they were also already in /usr/local/bin
.
PS - 我还移动了 redis-benchmark、redis-sentinel、redis-check-aof 和 redis-check-dump 文件,因为它们也已经在/usr/local/bin
.
Ref: http://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/
回答by decoder7283
Create a bash file...
创建一个 bash 文件...
cd ~
nano .update_redis
Then paste this...
然后贴这个...
cd /tmp
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make -j4
cp src/redis-cli /usr/bin/
cp src/redis-server /usr/bin/
cp src/redis-benchmark /usr/bin/
chmod 755 /usr/bin/redis-cli
chmod 755 /usr/bin/redis-server
chmod 755 /usr/bin/redis-benchmark
Execute
执行
bash .update_redis