第一次自制软件安装失败

First time homebrew installation failure

我刚刚在 Rails 上被介绍给 Ruby,我正在按照说明安装 "homebrew"(使用 Mac El Capitan 10.11.3)。我尝试通过从自制软件网站复制粘贴安装代码行来安装自制软件,但不知何故收到了 'failed during' 消息(这是我第一次尝试安装)。

我一无所知,所以我又重新输入了这行代码,这是出现的结果(第二次,我得到 'file exists' 和 'failed during'):

 ==> Downloading and installing Homebrew...
remote: Counting objects: 54, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 54 (delta 45), reused 40 (delta 33), pack-reused 0
Unpacking objects: 100% (54/54), done.
error: cannot lock ref 'refs/remotes/origin/master': Unable to 
create '/usr/local/Homebrew/.git/refs/remotes/origin/master.lock':
File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
From https://github.com/Homebrew/brew
! [new branch]      master     -> origin/master  (unable to update
local ref)
Failed during: git fetch origin master:refs/remotes/origin/master --
tags --force --depth=1

我完全不熟悉开发,不知道如何进行。有人有什么建议吗?

删除这个文件

/usr/local/Homebrew/.git/refs/remotes/origin/master.lock

尝试

rm -f /usr/local/Homebrew/.git/refs/remotes/origin/master.lock

然后重试