当我使用brew下载redis时
系统: macOS14
$ brew install redis
报错信息:
Error: git: unknown or unsupported macOS version: :dunno
Error: 'git' must be installed and in your PATH!
Warning: You are using macOS 14.
We do not provide support for this pre-release version.
It is expected behaviour that some formulae will fail to build in this pre-release version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from MacHomebrew on Twitter.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
Error: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
解决方法:
这个错误提示表明你的操作系统是一个预发布版本的 macOS 14,所以导致Homebrew的一些操作出现问题。同时,错误提示还指出你的系统没有安装开发者工具(Command Line Tools)。
为了解决这个问题,你可以按照以下步骤操作:
-
安装开发者工具(Command Line Tools)。打开终端,并执行以下命令:
$ xcode-select --install
这将打开一个对话框,提示你安装开发者工具。按照指引完成安装。
-
等待安装完成后,重新尝试你的操作。如果仍然遇到问题,建议等待正式版的 macOS 14 发布后再尝试使用Homebrew。
安装完成后下载redis:
(base) hanxuxian@hanxuxiandeMacBook-Air ~ % brew install redis
fatal: not in a git directory
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Warning: You are using macOS 14.
We do not provide support for this pre-release version.
It is expected behaviour that some formulae will fail to build in this pre-release version.
It is expected behaviour that Homebrew will be buggy and slow.
Do not create any issues about this on Homebrew's GitHub repositories.
Do not create any issues even if you think this message is unrelated.
Any opened issues will be immediately closed without response.
Do not ask for help from MacHomebrew on Twitter.
You may ask for help in Homebrew's discussions but are unlikely to receive a response.
Try to figure out the problem yourself and submit a fix as a pull request.
We will review it but may or may not accept it.
这是Homebrew给出的警告信息,其中包含了一些说明和建议。
- 缺少远程仓库 'origin':警告信息中提到,在指定的路径(/opt/homebrew/Library/Taps/homebrew/homebrew-services)下没有名为 'origin' 的远程仓库。这可能是由于配置错误或缺失引起的。你可以使用
git remote -v
命令来查看当前仓库的远程仓库配置,确认是否确实缺少名为 'origin' 的远程仓库。 - 此版本为预发布版本:警告信息中提到,你正在使用 macOS 14 的预发布版本。Homebrew在预发布版本上的支持可能有限,一些软件包可能无法构建,Homebrew可能会出现错误和缓慢的情况。Homebrew官方不会为预发布版本提供技术支持,并且不建议在此版本上创建问题报告。
报错信息:
Error: No such file or directory @ rb_sysopen - /Users/hanxuxian/Library/Caches/Homebrew/downloads/cfc74d213a6c97e0443cc2fc624f01864bb13a9d6d2e1906169e8ecad40ec9b8--ca-certificates-2022-10-11.all.bottle.tar.gz
这个错误提示表明在指定的路径下找不到指定的文件或目录。根据错误提示中的路径信息来看,这是Homebrew在尝试访问一个文件时遇到的问题。
可能的原因和解决方法如下:
- 检查文件路径是否正确:请确保你提供的文件路径是正确的,并且文件确实存在于该路径下。可以使用命令行中的
ls
命令来检查指定路径下的文件和目录列表,确保目标文件存在。 - 检查文件权限:如果文件存在但你无法访问它,可能是因为文件权限问题。使用命令
ls -l
可以查看文件的详细权限信息。如果需要,你可以使用chmod
命令更改文件权限以确保你有足够的权限访问该文件。 - 清理Homebrew缓存:Homebrew会将下载的软件包和文件缓存在本地。有时候,缓存文件可能会损坏或丢失,导致无法访问或使用它们。尝试使用
brew cleanup
命令来清理Homebrew的缓存,然后重新尝试你的操作。
这里其实是ca-certificates未成功下载
==> Installing dependencies for redis: ca-certificates and [email protected]
==> Installing redis dependency: ca-certificates
==> Pouring ca-certificates-2022-10-11.all.bottle.tar.gz
解决方法:
用brew单独下载依赖包,就避免了找不到依赖版本的错误
$ brew install ca-certificates
下载成功
继续执行brew install redis 报错:
==> Installing redis dependency: [email protected]
Error: An exception occurred within a child process:
FormulaUnreadableError: perl: unknown or unsupported macOS version: :dunno
根据错误信息,这个问题似乎是由于Homebrew无法识别或不支持你当前的macOS版本造成的。错误信息中提到了一个未知或不支持的macOS版本。
要解决这个问题,你可以尝试以下方法:
- 更新Homebrew:确保你使用的是最新版本的Homebrew。可以运行
brew update
命令来更新Homebrew并获取最新的版本信息。 - 检查macOS版本:确认你当前的macOS版本是否受到Homebrew支持。你可以在终端中运行
sw_vers
命令来查看你的macOS版本信息。
尝试更新Homebrew警告:
fatal: not in a git directory
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
不管它继续等待下载即可,如果不能下载尝试以下解决方法:
1、在homebrew-core目录下,执行了git remote -v:
$ cd /opt/homebrew/Library/Taps/homebrew/homebrew-core/
$ git remote -v
origin https://github.com/Homebrew/homebrew-core (fetch)
origin https://github.com/Homebrew/homebrew-core (push)
2、去homebrew-services目录下执行git remote -v:
$ cd /opt/homebrew/Library/Taps/homebrew/homebrew-services/
$ git remote -v
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-services'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services
3、根据提示添加:git安全路径
homebrew-services $ git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services
#再次执行,无提示成功
homebrew-services $ git remote -v
origin https://gitee.com/cunkai/homebrew-services.git (fetch)
origin https://gitee.com/cunkai/homebrew-services.git (push)
安装完成后:
To start redis now and restart at login:
brew services start redis
Or, if you don't want/need a background service you can just run:
/opt/homebrew/opt/redis/bin/redis-server /opt/homebrew/etc/redis.conf
要立即启动Redis并设置为登录时重启,可以运行以下命令:
brew services start redis
这将启动Redis服务,并配置为在系统登录时自动启动。
如果你不需要后台服务,只想手动运行Redis,可以使用以下命令:
/opt/homebrew/opt/redis/bin/redis-server or /opt/homebrew/etc/redis.conf
这将直接启动Redis服务器,并使用指定的配置文件。
标签:opt,git,Redis,redis,问题,homebrew,services,Homebrew,安装 From: https://www.cnblogs.com/HanXuxian/p/18285787