配置redis坑(1):安装wget,Mac频繁报错command not found解决,安装wget警告Warning: /usr/local/bin is not in your PATH.解

(2018.07.19)

1)本来在按照博客配置Redis,结果到启动redis-server的时候出错,猜想可能安装有问题,所以准备照着官网(https://redis.io/download)步骤重新装一遍,于是输入以下命令:

wget http://download.redis.io/releases/redis-4.0.10.tar.gz

结果报错“wget: command not found”,

接着以为是电脑没有wget,

2)于是按下面步骤安装wget:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  //执行安装brew

brew install wget  //安装wget

3)然后又报错没有brew,然后又查资料,改了下.bash_profile,结果之后各种命令都报错command not found了,网上说可能是把.bash_profile整坏了。。。

4)按照博客(https://www.cnblogs.com/cocos2dx-wk/p/3195857.html?utm_source=tuicool&utm_medium=referral),其中将.bash_profile全删了,关了终端重启

5)似乎好了,接着按照2)中步骤安装wget,有一个warning(可能是删了.bash_profile里面的内容造成的):

Warning: /usr/local/bin is not in your PATH.

安装wget,还是报错

-bash: brew: command not found

6)搜了下博客说是brew没有安装成功,(https://*.com/questions/14288682/error-installing-homebrew-brew-command-not-found)说在终端输入命令

export PATH=/usr/local/bin:$PATH

然后再输入

brew install wget

似乎安装成功了

7)接着按照redis官网(https://redis.io/download)来安装

$ wget http://download.redis.io/releases/redis-4.0.10.tar.gz

$ tar xzf redis-4.0.10.tar.gz

$ cd redis-4.0.10

$ make

然后run redis with:

$ src/redis-server

配置redis坑(1):安装wget,Mac频繁报错command not found解决,安装wget警告Warning: /usr/local/bin is not in your PATH.解

但是关闭服务器

redis-cli shutdown

好像没起作用,干脆直接把终端关了。。

 

附1:配置Redis时出错的命令:

tar -zxvf redis-version.tar.gz

cd 解压到的目录  //最后我在“ /Users/maoqiu ”找到了

make test  //执行编译测试

make install  //执行安装

 

redis-server  //启动redis-server

报错好像是找不到

也有博客(https://www.2cto.com/kf/201702/594187.html)上写启动命令是 “./redis-server”,但我还没试

 

附2:.bash_profile被整坏后,将其中内容全删前里面的内容(步骤(4)中):

# Setting PATH for Python 3.7

# The original version is saved in .bash_profile.pysave

PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"

export PATH

 

# added by Anaconda3 5.2.0 installer

export PATH="/Users/maoqiu/anaconda3/bin:$PATH"

 

export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"