【问题标题】:Homebrew Installed But Also Not InstalledHomebrew 已安装但也未安装
【发布时间】:2015-10-06 21:01:56
【问题描述】:

当我尝试安装自制软件时,我收到了这个错误。开始很简单,但后来我很困惑。

cjbrigna$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/bin/chgrp admin /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
fatal: unable to access 'https://github.com/Homebrew/homebrew/': Could not resolve host: github.com
Failed during: git fetch origin master:refs/remotes/origin/master -n --depth=1

没问题,github 宕机了一会儿。所以我稍后再试。

cjbrigna$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

这让我觉得我有自制软件。

cjbrigna$ brew help
-sh: brew: command not found

显然我没有自制软件。

cjbrigna$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
Failed to locate Homebrew!

现在我无法安装或卸载自制软件。这是没有意义的。我做错什么了?感谢您的帮助。

【问题讨论】:

  • ls -ld /usr/local/.git 打印什么?
  • drwxr-xr-x 11 cjbrigna 轮 374 Oct 6 16:04 /usr/local/.git
  • 我会尝试:cd /usr/local/.git && git pull 之后我会再尝试一次卸载脚本。
  • $ cd /usr/local/.git && git pull remote: Counting objects: 294789, done. remote: Compressing objects: 100% (29/29), done. remote: Total 294789 (delta 17), reused 0 (delta 0), pack-reused 294760 Receiving objects: 100% (294789/294789), 54.07 MiB | 11.79 MiB/s, done. Resolving deltas: 100% (221658/221658), done. From https://github.com/Homebrew/homebrew * [new branch] master -> origin/master There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details git pull <remote> <branch>
  • If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> master

标签: ruby operating-system homebrew osx-mavericks


【解决方案1】:

您可以手动完成install process

cd /usr/local
git fetch origin master:refs/remotes/origin/master -n --depth=1
git reset --hard origin/master

然后确保/usr/local/bin 在您的PATH 中。如果是,那么您应该能够运行例如brew help 检查 Homebrew 是否已安装。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-03
    • 2023-03-24
    • 2015-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多