1 下載redis :
網(wǎng)址:https://redis.io/download,下載 stable 版本名党,穩(wěn)定版本器躏。
2?解壓:
tar zxvf ?redis-5.0.4.tar.gz军俊。
3 將解壓后文件夾放到/usr/local
????mv redis-5.0.4????/usr/local/
? ? (這里可能會有usr/local 目錄的寫入權(quán)限問題,參考:http://www.reibang.com/p/a32224a38195)
4 切換到切換到相應(yīng)目錄
cd /usr/local/redis-5.0.4/
5.進入src目錄下面編譯redis
??? sudo make
??? 編譯成功后缆娃,會有一個提示: It's a good idea to run 'make test'
(這里可能會有“invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:/Library/Developer/CommandLineTools/usr/bin/xcrun”問題,解決方法很簡單瑰排,就是在命令行中執(zhí)行?xcode-select --install贯要,然后下載,安裝完成后凶伙,再重新編譯即可)
6.編譯test
?? sudo make test
成功后提示: ?All tests passed without errors
7.安裝
sudo make install
成功后提示:?It's a good idea to run 'make test'郭毕!
8.運行
redis-server