更新
brew --prefix
返回:
/usr/本地
语境
MacOs Mojave 桌面是:
- 最初配置为brew
- 添加了一个新用户
brew
每添加一个新组 ,指示用户 2 已添加到brew
组中:
将安装目录组更改为“brew”:
sudo chgrp -R brew $(brew --prefix)/*
“brew”组被授予写入权限:
sudo chmod -R g+w $(brew --prefix)/*
目标是brew
为任何用户启用该命令。
错误
brew update
回报
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/error.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/explicit_namespace.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/gem_inflector.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/inflector.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/kernel.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/loader.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/loader/callbacks.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/real_mod_name.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/registry.rb': Permission denied
warning: unable to unlink 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/version.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/error.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/explicit_namespace.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/gem_inflector.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/inflector.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/kernel.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/loader.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/loader/callbacks.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/real_mod_name.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/registry.rb': Permission denied
error: unable to unlink old 'Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/zeitwerk-2.3.1/lib/zeitwerk/version.rb': Permission denied
Already up-to-date.
问题
目标是brew
为用户 2 启用该命令。目录 /Library/Homebrew 不存在。
- 是什么导致
brew update
警告和错误消息? - 有哪些补救措施?
答案1
关于这条评论
在您的计算机上,由于某种原因它尝试触摸 /Library/Homebrew/
不,位置实际上是
/usr/local/Homebrew/Library/Homebrew/
- 是什么导致了 brew update 警告和错误消息?
- 有哪些补救措施?
为多用户配置添加组写入权限可以修复此问题:-
sudo chmod -R g+rwX /usr/local/Homebrew/Library/Homebrew/