[英]Why is brew install redis not working for mac M1?
我必須安裝 redis,但無法再使用 brew 安裝 redis。 嘗試以這種方式安裝時出現以下錯誤:
Warning: No available formula with the name "redis".
==> Searching for similarly named formulae and casks...
==> Casks
another-redis-desktop-manager ✔ redis-pro
jpadilla-redis redisinsight
medis
To install another-redis-desktop-manager ✔, run:
brew install --cask another-redis-desktop-manager ✔
嘗試了命令brew install --cask another-redis-desktop-manager
。 這也沒有用。
其實找到了答案。 基本上安裝失敗的原因是因為核心自制程序包沒有正確配置。 確定了brew doctor
的問題解決方案是
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
ARM Homebrew 必須安裝在 /opt/homebrew 目錄中。 早些時候,您需要手動創建目錄並運行命令。 但是,您無需手動運行命令即可使用最新的腳本。
直接執行:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
PS:終端類型 運行 echo $SHELL 命令。 命令output如下:
/bin/bash => bash =>.bash_profile /bin/zsh => zsh =>.zprofile 如果遇到無效的環境變量,建議您在設置正確的環境變量之前檢查終端類型。
從macOS Catalina(10.15.x)開始,Mac默認使用zsh Shell,使用.zprofile,所以對應命令:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
如果你有 macOS Mojave 或更高版本並且沒有自己配置 zsh,請使用.bash_profile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
希望這可以幫到你
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.