mac 安装redis时候
报xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) 的错
此时是因为mac没有安装xcode
运行
$ xcode-select --install
xcode-select: note: install requested for command line developer tools
即可安装
然后
sudo mv redis-7.2.4 /usr/local/
cd /usr/local/redis-7.2.4/
sudo make test
sudo make install
即可安装redis
接着启动redis
redis-server
52014:C 19 Mar 2024 20:00:48.785 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
52014:C 19 Mar 2024 20:00:48.785 * Redis version=7.2.4, bits=64, commit=00000000, modified=0, pid=52014, just started
52014:C 19 Mar 2024 20:00:48.785 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
52014:M 19 Mar 2024 20:00:48.788 * Increased maximum number of open files to 10032 (it was originally set to 2560).
52014:M 19 Mar 2024 20:00:48.788 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 7.2.4 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 52014
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
52014:M 19 Mar 2024 20:00:48.789 # WARNING: The TCP backlog setting of 511 cannot be enforced because kern.ipc.somaxconn is set to the lower value of 128.
52014:M 19 Mar 2024 20:00:48.789 * Server initialized
52014:M 19 Mar 2024 20:00:48.790 * Ready to accept connections tcp
运行redis-cli
redis-cli -h 127.0.0.1 -p 6379
127.0.0.1:6379> PING
PONG
127.0.0.1:6379>