gpt4 book ai didi

macos - Homebrew 不再 brew

转载 作者:行者123 更新时间:2023-12-03 09:03:22 26 4
gpt4 key购买 nike

在装有El Capitan的MacMini上,我无法再进行冲泡了。我收到以下错误:

/usr/local/Library/Homebrew/config.rb:34:in `initialize': no implicit conversion of nil into String (TypeError)
from /usr/local/Library/Homebrew/config.rb:34:in `new'
from /usr/local/Library/Homebrew/config.rb:34:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Library/Homebrew/global.rb:18:in `<top (required)>'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Library/brew.rb:10:in `<main>'

/ usr / local的权限正确。

我尚未更改的config.rb文件如下所示:
def cache
if ENV["HOMEBREW_CACHE"]
Pathname.new(ENV["HOMEBREW_CACHE"]).expand_path
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? && home_cache.writable_real?
home_cache
else
Pathname.new("/Library/Caches/Homebrew").extend Module.new {
def mkpath
unless exist?
super
chmod 0775
end
end
}
end
end
end

HOMEBREW_CACHE = cache
undef cache

# Where brews installed via URL are cached
HOMEBREW_CACHE_FORMULA = HOMEBREW_CACHE+"Formula"

unless defined? HOMEBREW_BREW_FILE
HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"] || which("brew").to_s
end

# Where we link under
HOMEBREW_PREFIX = Pathname.new(ENV["HOMEBREW_PREFIX"])

# Where .git is found
HOMEBREW_REPOSITORY = Pathname.new(ENV["HOMEBREW_REPOSITORY"])

HOMEBREW_LIBRARY = Pathname.new(ENV["HOMEBREW_LIBRARY"])
HOMEBREW_CONTRIB = HOMEBREW_REPOSITORY/"Library/Contributions"

# Where we store built products
HOMEBREW_CELLAR = Pathname.new(ENV["HOMEBREW_CELLAR"])

HOMEBREW_LOGS = Pathname.new(ENV["HOMEBREW_LOGS"] || "~/Library/Logs/Homebrew/").expand_path

HOMEBREW_TEMP = Pathname.new(ENV.fetch("HOMEBREW_TEMP", "/tmp"))

unless defined? HOMEBREW_LIBRARY_PATH
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.parent.join("Homebrew")
end

HOMEBREW_LOAD_PATH = HOMEBREW_LIBRARY_PATH

brew , brew 医生, brew 更新等也会发生相同的错误。

有什么想法,可能有什么问题吗?

最佳答案

我遇到了同样的问题-似乎是由于权限问题而无法完成的brew更新的结果。

首先,我将仓库重置为最新的目录:

cd /usr/local/bin
git reset --hard HEAD

然后我可以运行:
brew doctor

发现权限问题。按照说明修复这些权限最终使我可以运行:
brew update

关于macos - Homebrew 不再 brew ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34907017/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com