==> Fetching xz ==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/c7f385112a4c2b9eed76b346d11d333fa8954a89/Formula/x/xz.rb Already downloaded: /Users/wboll/Library/Caches/Homebrew/downloads/049af374432798d3b924a0d36bdcd6500060181a0d37c5006b599925291e7b5a--xz.rb Error: xz: undefined method `deny_network_access!' for Formulary::FormulaNamespacea8b7b798f9dedacccefb9c2c256d10d4::Xz:Class
解决 deny_network_access!
方法未定义的问题
打开 xz.rb
文件,注释掉 deny_network_access!
这一行:
# deny_network_access! [:build, :postinstall]
保存文件后,再次尝试使用 Homebrew 安装 xz
。
==> Fetching xz ==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/86844500ea167c537365f4e5b8c977e93e4e134b/Formula/x/xz.rb Already downloaded: /Users/wboll/Library/Caches/Homebrew/downloads/6c130d29481c5cd57e697ae48a493f39eab1c05cd6f9cd4fa610e5cb9e5927c1--xz.rb Error: ffmpeg: SHA256 mismatch Expected: 700b0cb0d7004809e5bd37cad2e6e4132c88d3cc69dd0955ffd4a8cd83ae7a03 Actual: 385c968290353a68b7d3e0f3684d76e7266647d6cc3a74314fff182f0eaec1bd File: /Users/wboll/Library/Caches/Homebrew/downloads/6c130d29481c5cd57e697ae48a493f39eab1c05cd6f9cd4fa610e5cb9e5927c1--xz.rb To retry an incomplete download, remove the file above.
brew upgrade
https://github.com/tukaani-project/xz/releases/tag/v5.6.2
tar xfv xxx.gz
cd xxx
./configure --prefix=/usr/local/Cellar
make
make install
ln -s /usr/local/bin/xz /usr/local/Cellar/xz/5.2.10/bin
brew link --overwrite --force x
brew unlink xz && brew link xz
ln -s /usr/local/Cellar/bin/xz /usr/local/Cellar/xz/5.6.2/bin
cd /usr/local/Cellar/xz/5.6.2
brew unlink xz(可能用到)
brew link --overwrite --force xz
标签:xz,deny,undefined,--,access,usr,rb,network From: https://www.cnblogs.com/qk1314/p/18387403