Homebrew 生成两个警告

发布于 2024-10-26 22:27:23 字数 867 浏览 0 评论 0原文

我使用 Homebrew 作为包管理器。我运行这个命令:

brew update

但我得到了这个错误:

错误:无法取消链接旧的“bin/brew”(权限被拒绝)

错误:执行 git pull 时失败 http://github.com/mxcl/homebrew.git大师

在 sudo 下再次运行:

/usr/local/Library/Homebrew/brew.h.rb:1:警告:已初始化常量 FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2:警告:已初始化常量 PLEASE_REPORT_BUG 错误:以下未跟踪的工作树文件将被签出覆盖:

.gitignore
;;;大名单在这里;;;;

现在,每个brew命令都会生成这些警告:

/usr/local/Library/Homebrew/brew.h.rb:1:警告:已初始化常量 FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2:警告:已初始化常量 PLEASE_REPORT_BUG

知道出了什么问题吗?

I use Homebrew as the package manager. I run this command:

brew update

But I got this error:

error: unable to unlink old 'bin/brew' (Permission denied)

Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master

Running again under sudo:

/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG
error: The following untracked working tree files would be overwritten by checkout:

.gitignore
;;; big list goes here ;;;;

And now, every brew command generates these warning:

/usr/local/Library/Homebrew/brew.h.rb:1: warning: already initialized constant FORMULA_META_FILES
/usr/local/Library/Homebrew/brew.h.rb:2: warning: already initialized constant PLEASE_REPORT_BUG

Any idea what is going wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠北森屋 2024-11-02 22:27:23

听起来好像是更新了一半才出错,现在状态很糟糕。您可能希望

cd /usr/local && git reset --hard HEAD

将所有 git 控制的文件(例如自制程序)重置回其原始版本。您可能需要 sudo 该 git 命令。之后,您可以尝试根据需要修复权限(如果该目录中没有文件需要被拥有,这可能就像运行 sudo chown -R yourname:staff /usr/local 一样简单)他人)。

It sounds like half of it updated before it errored out, and now it's in a bad state. You may want to

cd /usr/local && git reset --hard HEAD

That should reset all git-controlled files (e.g. homebrew) back to their pristine versions. You may need to sudo that git command. After that, you can attempt to fix the permissions however you want (this may be as simple as running sudo chown -R yourname:staff /usr/local if no files in that dir need to be owned by someone else).

小巷里的女流氓 2024-11-02 22:27:23

确保 /usr/local/bin 对用户帐户具有写权限。

Make sure that /usr/local/bin has write permissions for the user account.

盗梦空间 2024-11-02 22:27:23

我今天遇到了类似的问题,这为我指明了正确的方向,但重置还不够。我不知道如何,但不知怎的,我在运行git status后注意到有很多未跟踪的文件。

我终于复制了所有文件(只是为了安全起见)并删除了它们,之后brew更新就像一个魅力

I had a similar issue today, this pointed me in the right direction, but the reset was not enough. I am not sure how, but somehow I had quite a few untracked files, I noticed after running git status.

I finally made a copy of all the files (just to be safe) and deleted them, after that brew update worked like a charm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文