2017-09-28 89 views

回答

46

問題保持發生。 ..深入挖掘後,我發現只有卸載Homebrew然後重新安裝它解決了這個問題。

卸載自制:如果您正在使用的zsh 因爲你是從哪裏來的,你可能需要改變你的$ PATH慶典

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 
+1

這是修復「高」Sierra升級後我的自制軟件的唯一方法。 我的錯誤是: 'gh4x-mbpr:〜gh4x $釀造環節混帳 鏈接/usr/local/Cellar/git/2.15.0 ...錯誤:權限被拒絕@ dir_s_mkdir - 在/ usr /本地/ lib' 和 '須藤喬敦 - R的$(WHOAMI)$(BREW --prefix)/ *' 沒有幫助... – gh4x

+0

爲我工作,謝謝! –

29

不幸的是,你不能再在高山脈中播放/usr/local。一種解決方法是sudo mkdir /usr/local/include/usr/local/Frameworks如果它們不存在,並

sudo chown -R $(whoami) $(brew --prefix)/*

感謝ilovezfs這個簡單的解決方法和驚人的自制軟件!

+6

仍然沒有工作。 $ brew update 錯誤:/ usr/local目錄不可寫入。 –

+2

同上。看起來像上次更新的高山... – ruggershawn

+0

嘗試卸載並重新安裝Homebrew:https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx -10-13-high-sierra – ruggershawn

7

我跟着this但問題仍然存在。
因此,我重新安裝了自制軟件,而無需卸載以前的軟件。它正在工作!
(我不知道如何)

+2

我建議徹底卸載Homebrew並重新安裝。 – k1r8r0wn

+1

重新安裝Homebrew爲我工作 –

+0

多個安裝的工作,我無法修復它,直到我卸載。 – cbowns

1

您不能爲/usr/local本身變更許可,但你可以改變文件夾下的權利許可,所以這個固定的
sudo chown -R $(whoami) /usr/local/*

+0

獲得同樣的問題仍然是 –

0

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" 

然後重新安裝。 你應該添加export PATH=$HOME/bin:/usr/local/bin:$PATH 在.zshrc

然後它應該工作,這個問題通過這種方式解決在我的mac。

0

嘗試禁用System Integrity Protection。從文檔:

System Integrity Protection can be configured using the csrutil(1) command.

You can check whether System Integrity Protection is currently enabled on your system by running the following command in the Terminal:

$ csrutil status 
System Integrity Protection status: enabled. 

To enable or disable System Integrity Protection, you must boot to Recovery OS and run the csrutil(1) command from the Terminal.

Boot to Recovery OS by restarting your machine and holding down the Command and R keys at startup. Launch Terminal from the Utilities menu. Enter the following command: $ csrutil enable

After enabling or disabling System Integrity Protection on a machine, a reboot is required.

+0

雖然這可能在理論上回答這個問題,但[這將是更可取的](// meta.stackoverflow.com/q/8259)在這裏包括答案的基本部分,並提供了供參考的鏈接。 –

+0

儘管這個鏈接可能回答這個問題,但最好在這裏包含答案的基本部分,並提供供參考的鏈接。如果鏈接頁面更改,則僅鏈接答案可能會失效。 - [來自評論](/ review/low-quality-posts/18881025) –

+0

我做了這件事,謝謝! –

相關問題