首页 > 数据库 >安装Redis出现的问题

安装Redis出现的问题

时间:2024-07-05 14:42:06浏览次数:14  
标签:opt git Redis redis 问题 homebrew services Homebrew 安装

当我使用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)。

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

  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单独下载依赖包,就避免了找不到依赖版本的错误

$ 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,问题,homebrew,services,Homebrew,安装
From: https://www.cnblogs.com/HanXuxian/p/18285787

相关文章

  • Redis快速上手
    Redis检查Redis是否安装$redis-server--versionRedisserverv=7.2.4sha=00000000:0malloc=libcbits=64build=2d86b7859915655e如果成功安装,则会显示Redis的版本号。启动RedisMac:终端输入:$redis-serverWin:终端输入:$redis-server.exe启动后显示版本号和端口......
  • openEuler下安装mysql
    环境:Os:openEuler2203sp41.1介质准备mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz该介质可以从官网上进行下载 1.1创建mysql用户和用户组root@ecs-d7c2-0417412~]#groupaddmysqlroot@ecs-d7c2-0417412~]#useraddmysql-s/sbin/nologin-M-gmysql1.1下载解压二......
  • Redis数据结构-字典的实现
    字典,又称符号表(symboltable)、关联数组(associativearray)或者映射(map),是一种用于保存键值对(key-valuepair)的抽象数据结构。在字典中,一个键(key)可以和一个值(value)进行关联(或者说将键映射为值),这些关联的键和值就被称为键值对。字典中的每个键都是独一无二的,程序可以在字典......
  • 手把手教你解决spring boot导入swagger2版本冲突问题,刘老师教编程
    手把手教你解决springboot导入swagger2版本冲突问题本文仅为个人理解,欢迎大家批评指错首先SpringBoot3和Swagger2不兼容。在SpringBoot3中,应该使用Springdoc或其他与SpringBoot3兼容的API文档工具来替代Swagger2。Swagger2的依赖底层使用的是javax......
  • Linux(Centos7)安装Docker 社区(ce)版
    安装准备查看Linux系统版本是否为centos7cat/etc/os-release确保系统内核为3版本以上uname-a安装Docker如之前安装过请卸载yumremovedocker\docker-client\docker-client-latest\docker-common\......
  • Linux虚拟机配置杂项问题汇总
    下面提到的相关问题,大部分是基于Ubuntu系统进行操作的,因为CentOS在我目前实践中涉及较少。因此如无明确提及系统,均默认在Ubuntu、debian一类系统中操作。1、更新root密码:新创建的虚拟机有时没有设置root密码导致进入root权限麻烦,使用如下命令可以设置密码。sudopasswdroot2......
  • Kali网卡失效IP不显示问题解决
    因为我的个人习惯,通常为虚拟机配置两个网卡,一个Host-only网卡用于与主机进行通信、一个网络地址转换网卡用于访问网络。然而,在配置Kali主机时,常常遇到网络地址转换网卡断联的现象,导致虚拟机无法正常访问网络。根据先前的经验,问题出在网络配置上。查看/etc/network/interfaces文......
  • 谷粒商城学习-11-docker安装redis
    文章目录一,拉取Redis镜像1,搜索Redis的Docker镜像2,拉取Redis镜像3,查看已经拉取的镜像二,创建、启动Redis容器1,创建redis配置文件2,创建及运行Redis容器3,使用dockerps查看运行状态的容器4,验证容器是否可用三,修改Redis配置文件一,拉取Redis镜像1,搜索Redis的Docker镜像......
  • windows安装以及切换使用nodejs多版本
    1安装nvmnvm是一个简单的bash脚本,它是用来管理系统中多个已存的Node.js版本。可以先把系统已有的node卸载掉,也可不卸载,但是以防没必要的冲突,尽量还是卸掉。1.1下载nvm下载地址:https://github.com/coreybutler/nvm-windows/releases,下载.zip后缀的这个文件,下载后解压安装即可......
  • mysql数据库安装
    mysql数据库安装1.从官网下载yum包直接使用wget下载yum包wgethttp://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm​​2.安装软件源rpm-Uvhmysql57-community-release-el7-10.noarch.rpm​​3.安装Mysql服务端yuminstall-ymysql-communi......