没有这样的桶:/ usr / local / Cellar / git [英] No such keg: /usr/local/Cellar/git

查看:1272
本文介绍了没有这样的桶:/ usr / local / Cellar / git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在为此奋斗了几个小时。我使用优胜美地在Mac上。我安装了自制软件,并且使用git就好了。我尝试了 $ git add -i ,我得到了这个错误:


Can在@INC中找到Git.pm(@INC包含:

所以我按照这里的说明操作:
无法在@INC中找到Git.pm



$ brew uninstall git 工作正常,但在尝试 $ brew install git I 'b
$ b

 %brew安装git 

错误:git-git已安装
要安装此版本,请先brew unlink git'
%brew unlink git
错误:没有这样的桶:/ usr / local / Cellar / git
brew链接git
错误:没有这样的桶:/ usr / local / Cellar / git
%git --version
git版本1.9.3(Apple Git-50)
%brew升级git
==>升级1个过期的软件包,结果如下:
git 2.2.2
错误:/ usr / local / Library / LinkedKegs / git不是有效的桶
% brew install git
错误:git-git已经安装了
要安装这个版本,首先`brew unlink git'

我只想得到自制&重新恢复正常并再次链接到正确的回购。我真的很粗糙,在这个东西的边缘,所以任何帮助将不胜感激!

解决方案

删除git的brew版本

  brew卸载--force git 

然后清理所有旧版本并清除brew缓存

  brew清理--force -s git 

删除任何死链符号链接

  brew prune 

然后尝试重新安装git

  brew install git 

如果这不起作用,我会完全删除Homebrew的安装并重新安装它。如果您还没有在 brew --prefix 目录(默认情况下为 / usr / local )中放置其他任何内容,您可以简单地 rm -rf $(brew --prefix)。否则,Homebrew wiki建议在 https://gist.github.com/上使用脚本mxcl / 1173223#file-uninstall_homebrew-sh


I have been struggling with this for a few hours. I am on a Mac using Yosemite. I had homebrew installed, and was using git just fine. I tried doing $git add -i and I got this error:

Can't locate Git.pm in @INC (@INC contains:

So I followed the instructions here: Can't locate Git.pm in @INC

$brew uninstall git worked fine, but after I tried to $brew install git I've been stuck in a terrible cycle.

% brew install git

Error: git-git already installed
To install this version, first `brew unlink git'
% brew unlink git
Error: No such keg: /usr/local/Cellar/git
% brew link git
Error: No such keg: /usr/local/Cellar/git
% git --version
git version 1.9.3 (Apple Git-50)
% brew upgrade git
==> Upgrading 1 outdated package, with result:
git 2.2.2
Error: /usr/local/Library/LinkedKegs/git is not a valid keg
% brew install git
Error: git-git already installed
To install this version, first `brew unlink git'
%

I just want to get homebrew & git back to normal and linked to the correct repo again. I'm really rough around the edges at this stuff, so any help would be greatly appreciated!

解决方案

Give another go at force removing the brewed version of git

brew uninstall --force git

Then cleanup any older versions and clear the brew cache

brew cleanup --force -s git

Remove any dead symlinks

brew prune

Then try reinstalling git

brew install git

If that doesn't work, I'd remove that installation of Homebrew altogether and reinstall it. If you haven't placed anything else in your brew --prefix directory (/usr/local by default), you can simply rm -rf $(brew --prefix). Otherwise the Homebrew wiki recommends using a script at https://gist.github.com/mxcl/1173223#file-uninstall_homebrew-sh

这篇关于没有这样的桶:/ usr / local / Cellar / git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆