brew 를 이용하여 맥 어플리케이션을 설치 할 때, 아래와 같이 Permission 에러가 발생하는 경우가 있습니다.
❯ brew cask install slowquitapps
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (caskroom/cask).
No changes to formulae.
==> Satisfying dependencies
==> Downloading https://github.com/dteoh/SlowQuitApps/releases/download/v0.4.0/SlowQuitApps.z
Already downloaded: /Users/Roh/Library/Caches/Homebrew/Cask/slowquitapps--0.4.0.zip
==> Verifying checksum for Cask slowquitapps
==> Installing Cask slowquitapps
==> Purging files for version 0.4.0 of Cask slowquitapps
Error: Permission denied @ dir_s_mkdir - /usr/local/Caskroom/slowquitapps
Follow the instructions here:
https://github.com/caskroom/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:225: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'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:144:in `extract_primary_container'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:58:in `stage'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:79:in `install'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:20:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:14:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/install.rb:14:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:98:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:101:in `<main>'
위와 같은 에러가 발생할 경우, 어플리케이션이 설치 될 Path (위 예제에서는 /usr/local/Caskroom) 에 아래와 같이 권한을 부여하면 Permission 에러를 해결 할 수 있습니다.
❯ sudo install -d -o $(whoami) -g admin /usr/local/Caskroom
Password: 비밀번호
❯ brew cask install slowquitapps
Updating Homebrew...
==> Satisfying dependencies
==> Downloading https://github.com/dteoh/SlowQuitApps/releases/download/v0.4.0/SlowQuitApps.z
Already downloaded: /Users/Roh/Library/Caches/Homebrew/Cask/slowquitapps--0.4.0.zip
==> Verifying checksum for Cask slowquitapps
==> Installing Cask slowquitapps
==> Moving App 'SlowQuitApps.app' to '/Users/Roh/Applications/SlowQuitApps.app'.
🍺 slowquitapps was successfully installed!
~ 13s
❯