Permission denied @ dir_s_mkdir - /usr/local/Caskroom/v2rayu with homebrew

Error: Permission denied @ dir_s_mkdir - /usr/local/Caskroom/v2rayu with homebrew

环境介绍:

Mojave 10.14.6

错误描述

Updating Homebrew...
^C==> Satisfying dependencies
==> Downloading https://github.com/yanue/V2rayU/releases/download/1.4.0/V2rayU.dmg
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.com/152742185/e8625580-a9a4-11e9-993b-d1aabc38ec09?X-Amz-Algorithm=AWS4-HMAC-SHA25
######################################################################## 100.0%
==> Verifying SHA-256 checksum for Cask 'v2rayu'.
==> Installing Cask v2rayu
==> Purging files for version 1.4.0 of Cask v2rayu
Error: Permission denied @ dir_s_mkdir - /usr/local/Caskroom/v2rayu
Follow the instructions here:
  https://github.com/Homebrew/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:254:in `mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:254:in `fu_mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:228:in `block (2 levels) in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:226:in `reverse_each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:226:in `block in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:211:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/pathname.rb:576:in `mkpath'
/usr/local/Homebrew/Library/Homebrew/unpack_strategy.rb:122:in `extract'
/usr/local/Homebrew/Library/Homebrew/unpack_strategy.rb:143:in `block in extract_nestedly'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
/usr/local/Homebrew/Library/Homebrew/unpack_strategy.rb:127:in `extract_nestedly'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:189:in `extract_primary_container'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:77:in `stage'
/usr/local/Homebrew/Library/Homebrew/cask/installer.rb:99:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:23:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/install.rb:16:in `each'

解决方法:

sudo chown -R $(whoami):staff ~/Library/Caches/Homebrew /usr/local/Caskroom/

你可能感兴趣的:(mac,homebrew,----------Mac,OSX)