Cannot update brew in MAC OS X el capitan and keep getting a Load error with `require`

后端 未结 1 411
时光取名叫无心
时光取名叫无心 2021-01-30 00:04

I am not sure why this is happening but I cannot update brew in my MAC OS X El Capitan. I did:

brew update

and got:

warning: unable          


        
1条回答
  •  野的像风
    2021-01-30 00:32

    You shouldn’t use sudo with Homebrew. First run the following to ensure you own everything under /usr/local:

    sudo chown -R $(whoami):admin /usr/local
    

    Alternative command for newer macOS version:

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

    Then reset your Homebrew repo to a clean state:

    cd /usr/local && git fetch && git reset --hard origin/master
    

    It should fix your issues.

    (replace /usr/local with $(brew --prefix) if you installed Homebrew elsewhere)

    0 讨论(0)
提交回复
热议问题