brew install gitとかすると/Library/Cachesを見に行ってしまい、permission deniedって怒られてしまう状況になってしまった。
-% brew install git
Error: Permission denied - /Library/Caches
こんな感じ
どうも~/Library/Caches/Homebrew
ってディレクトリがないと/Library/Caches/Homebrew
をキャッシュに使うようになってるみたい。
なのでディレクトリ作ってやったらちゃんと動くようになりました。
勢い余って消しちゃったのかしらん。。
ちなみに
global.rbの18行目あたりからが多分該当箇所
/usr/local/Library/Homebrew/global.rb
def cache
if ENV['HOMEBREW_CACHE']
Pathname.new(ENV['HOMEBREW_CACHE'])
else
# we do this for historic reasons, however the cache *should* be the same
# directory whichever user is used and whatever instance of brew is executed
home_cache = Pathname.new("~/Library/Caches/Homebrew").expand_path
if home_cache.directory? and home_cache.writable_real?
home_cache
else
root_cache = Pathname.new("/Library/Caches/Homebrew")
class << root_cache
alias :oldmkpath :mkpath
def mkpath
unless exist?
oldmkpath
chmod 0777
end
end
end
root_cache
end
end
end