简体   繁体   English

为什么 brew install redis 不适用于 mac M1?

[英]Why is brew install redis not working for mac M1?

I have to install redis, but it is not working to install redis anymore using brew.我必须安装 redis,但无法再使用 brew 安装 redis。 Getting the following error when trying to install this way:尝试以这种方式安装时出现以下错误:

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 ✔

Tried the command brew install --cask another-redis-desktop-manager .尝试了命令brew install --cask another-redis-desktop-manager This also didn't work.这也没有用。

Actually found the answer.其实找到了答案。 Basically the reason for the failure in installation was because the core homebrew packages were not correctly configured.基本上安装失败的原因是因为核心自制程序包没有正确配置。 Identified the issue with brew doctor The solution was确定了brew doctor的问题解决方案是

rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core

ARM Homebrew must be installed in the /opt/homebrew directory. ARM Homebrew 必须安装在 /opt/homebrew 目录中。 Earlier, you need to manually create directories and run commands.早些时候,您需要手动创建目录并运行命令。 However, you do not need to manually run commands to use the latest scripts.但是,您无需手动运行命令即可使用最新的脚本。

Direct execution:直接执行:

/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"

PS: terminal type Run the echo $SHELL command. PS:终端类型 运行 echo $SHELL 命令。 The command output is as follows:命令output如下:

/bin/bash => bash =>.bash_profile /bin/zsh => zsh =>.zprofile If you encounter invalid environment variables, you are advised to check the terminal type before setting the correct environment variables. /bin/bash => bash =>.bash_profile /bin/zsh => zsh =>.zprofile 如果遇到无效的环境变量,建议您在设置正确的环境变量之前检查终端类型。

Starting with macOS Catalina(10.15.x), Macs use zsh as the default Shell, using.zprofile, so the corresponding command:从macOS Catalina(10.15.x)开始,Mac默认使用zsh Shell,使用.zprofile,所以对应命令:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

If you have macOS Mojave or later and have not configured zsh yourself, use.bash_profile:如果你有 macOS Mojave 或更高版本并且没有自己配置 zsh,请使用.bash_profile:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"

Hope this can help you希望这可以帮到你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM