前言
最近換了M1 pro的新版mbp厚柳,在啟動本地redis跑項目時柠掂,提示以下內(nèi)容,告訴我brew不能用了
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
意思就是說arm架構和Intel架構的不同费韭,brew目錄需要放在/opt/homebrew 下茧球,而不是/usr/local下了。
解決方法
- 去/opt下創(chuàng)建homebrew文件夾星持,需要使用管理員權限
cd /opt
sudo mkdir homebrew
- 通過github克隆新的brew文件包
git clone https://github.com/Homebrew/brew homebrew
- 更新brew并賦予權限
eval "$(homebrew/bin/brew shellenv)"
brew update --force --quiet
chmod -R go-w "$(brew --prefix)/share/zsh"