2015-10-06 148 views
0

當我試圖安裝自制軟件時,我得到了這個錯誤。它開始很簡單,但後來我很困惑。自制安裝,但也沒有安裝

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! 

現在我無法安裝或卸載自制軟件。這沒有意義。我做錯了什麼?我感謝任何幫助。

+0

'ls -ld/usr/local/.git'打印什麼? – cel

+0

drwxr-xr-x 11 cjbrigna wheel 374 Oct 6 16:04 /usr/local/.git – Chase

+0

我試試看:'cd /usr/local/.git && git pull'之後我會嘗試卸載腳本時間。 – cel

回答

-1

嘗試看看下面:

  1. 確保您有最新的命令行工具,然後將它們安裝;
  2. 安裝Xquartz(最新版本),因爲它不再作爲10.9和Xcode的一部分安裝;

之後就可以了。

要解決卸載問題使用:rm -rf /usr/local/.git 如果您還有問題檢查的詳細信息:here

+0

刪除git存儲庫而不刪除所有未經檢查的文件是一個可怕的想法。 – cel

+0

ok @cel,我假設用戶在(bitbucket,github)之前保存了他的代碼,上面的解決方案在我的情況下工作。你有更好的主意嗎? – ddeveloperr

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。