首页 > 数据库 >macOS14使用brew下载Redis时出现的问题和解决方法

macOS14使用brew下载Redis时出现的问题和解决方法

时间:2024-03-05 10:12:55浏览次数:29  
标签:opt git Redis redis services Homebrew brew homebrew macOS14

当我使用brew下载redis时

系统: macOS14

(base) hanxuxian@hanxuxiandeMacBook-Air ~ % 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)。

为了解决这个问题,你可以按照以下步骤操作:

  1. 安装开发者工具(Command Line Tools)。打开终端,并执行以下命令:

    xcode-select --install
    

    这将打开一个对话框,提示你安装开发者工具。按照指引完成安装。

  2. 等待安装完成后,重新尝试你的操作。如果仍然遇到问题,建议等待正式版的 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给出的警告信息,其中包含了一些说明和建议。

  1. 缺少远程仓库 'origin':警告信息中提到,在指定的路径(/opt/homebrew/Library/Taps/homebrew/homebrew-services)下没有名为 'origin' 的远程仓库。这可能是由于配置错误或缺失引起的。你可以使用 git remote -v 命令来查看当前仓库的远程仓库配置,确认是否确实缺少名为 'origin' 的远程仓库。
  2. 此版本为预发布版本:警告信息中提到,你正在使用 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在尝试访问一个文件时遇到的问题。

可能的原因和解决方法如下:

  1. 检查文件路径是否正确:请确保你提供的文件路径是正确的,并且文件确实存在于该路径下。可以使用命令行中的 ls 命令来检查指定路径下的文件和目录列表,确保目标文件存在。
  2. 检查文件权限:如果文件存在但你无法访问它,可能是因为文件权限问题。使用命令 ls -l 可以查看文件的详细权限信息。如果需要,你可以使用 chmod 命令更改文件权限以确保你有足够的权限访问该文件。
  3. 清理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单独下载依赖包,就避免了找不到依赖版本的错误

(base) hanxuxian@hanxuxiandeMacBook-Air ~ % 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版本。

要解决这个问题,你可以尝试以下方法:

  1. 更新Homebrew:确保你使用的是最新版本的Homebrew。可以运行brew update命令来更新Homebrew并获取最新的版本信息。
  2. 检查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,services,Homebrew,brew,homebrew,macOS14
From: https://www.cnblogs.com/HanXuxian/p/18053368

相关文章

  • Redis - 字典的实现与哈希冲突解决
    1.字典的实现edis的字典数据类型的实现主要分为两个部分:typedefstructdict{dictType*type;void*privdata;dicththt[2];longrehashidx;unsignedlongiterators;}dict;其中,type属性表示字典的类型,而privdata属性表示字典的私有数据,它是......
  • Redis学习之路
    Redis代码成就万世基积沙镇海梦想永在凌云意意气风发一.是什么,有什么用用来解决数据量太大。数据索引太大,内存放不下。读写量(读写混合),单独的服务器承受不了。减轻服务器压力,使用缓存来保证效率(主要是用来解决读的问题)。Cache有时间局部性和空间局部性垂......
  • Redis整合Springboot
    六.巅峰1.事务Redis单条命令保证原子性,但是事务不保证原子性原子性:要么同时成功,要么同时失败Redis的事物本质:一组命令的集合,一个事务中的所有命令都会被序列化,事务执行过程中,会按照顺序执行。具有一次性,顺序性,排他性(没有隔离级别的概念)所有的命令在事务中,并没有直接执行,只有......
  • Redis在游戏开发中的几种应用场景
    Redis特点1.内存数据库Redis数据主要存储在内存,综合性能标准100k+QPS。需要说明下,十万QPS只是个综合参考,实际性能跟CPU性能、操作的命令复杂度有较大关系,对于简单的set/get操作50万QPS也没问题。2.丰富的数据结构所有Redis的数据都是以key-value键值对的形式存在......
  • 【Redis】Redis如何保证和MySQL数据库的数据一致性
    保障MySQL和Redis数据一致性需要使用不同的策略和技术,因为两者是不同的数据存储系统。以下是一些常见的方法:1.数据同步MySQL数据同步至Redis使用事件驱动机制:当MySQL中的数据更新时,通过触发器或者其他事件驱动的机制,将数据同步至Redis。定时任务:定期轮询MySQL数据......
  • laravel8 + redis 队列
      执行命令生成job: phpartisanmake:job自定义名称修改queue.php配置文件'redis'=>['driver'=>'redis','connection'=>'queue',【databases.php中单独配置一个redis的链接名为queue】'queue'=>en......
  • redis自学(10)Set
    Set是Redis中的单列集合,满足下列特点:不保证有序性保证元素唯一(可以判断元素是否存在)求交集、并集、差集  以上操作,都需要判断元素是否存在,因此可以看出,Set对查询元素的效率要求非常高 Set是Redis中的集合,不一定确保元素有序,可以满足元素唯一、查询效率要求极高。为了......
  • Redis技术论点
    Redis单线程&&多线程问题redis是单线程还是多线程在redis4.X之前的版本,redis是单线程;redis4.X版本之后,陆续开始支持多线程,比如持久化过程,但是核心工作线程仍然是单线程;redis6.X之后,redis针对部分设计大量数据操作,存在阻塞线程风险的命令提供了异步操作,如:zrange、ZRANK、flusdb等......
  • Linux安装Docker并搭建MySql、Redis、RabbitMQ
    1.1安装docker(1)删除老版本sudoyumremovedocker\docker-client\docker-client-latest\docker-common\docker-latest\docker-latest-logrotate\......
  • Redis的常用数据类型与操作
    Redis简介Redis是一个基于内存的key-value结构数据库(内存存储)(键值对)Mysql是将数据,是通过数据文件的方式存放在磁盘上(磁盘存储)(二维表)Redis特点抢购秒杀,或者新闻热点,大量的用户去访问的数据,就适合存放在Redis中,是对mysql的补充,往往项目中是和mysql共存的状态redis进行cmd命令......