赞
踩
1、首先命令行进行安装
brew install php@8.0
第一次安装可能会出现的问题
a、安装版本问题
- Warning: No available formula with the name "php@8.4". Did you mean php@8.1, php@8.0 or php@7.4?
- ==> Searching for similarly named formulae and casks...
- ==> Formulae
- php@8.1 php@8.0 php@7.4
-
- To install php@8.1, run:
- brew install php@8.1
出现该问题的原因安装的版本问题,根据提示进行下载安装对应的版本即可
b、出现error
- fatal: not in a git directory
- Error: Command failed with exit 128: git
解决办法:直接运行brew -v
brew -v
- mark@192 ~ % brew -v
- Homebrew 4.0.19-9-g8aaf99e
- fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
- To add an exception for this directory, call:
-
- git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
- Homebrew/homebrew-core (no Git repository)
- fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
- To add an exception for this directory, call:
-
- git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
- Homebrew/homebrew-cask (no Git repository)
看到有两个git config,分别运行一下即可,如下
- mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
- mark@192 ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
完成之后在运行:arch -arm64 brew install cocoapods
mark@192 ~ % arch -arm64 brew install cocoapods
运行结果
- ==> Downloading https://formulae.brew.sh/api/formula.jws.json
- ################################################################################################################### 58.8%curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 5 seconds
-
- Warning: formula.jws.json: update failed, falling back to cached version.
- ==> Downloading https://formulae.brew.sh/api/formula.jws.json
- ##################################################################################################################################################################################################### 100.0%
- ==> Downloading https://formulae.brew.sh/api/cask.jws.json
- ##################################################################################################################################################################################################### 100.0%
- Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
- ==> Fetching dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
- ==> Fetching libyaml
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/libyaml-0.2.5.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Fetching ca-certificates
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ca-certificates-2023-01-10.all.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/08486bb5b9927def5c947c5a9e4a873eacd6364ac9cf6e50bfe3aa0bfc1c63ed--ca-certificates-2023-01-10.all.bottle.tar.gz
- ==> Fetching openssl@1.1
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/openssl%401.1-1.1.1t.arm64_ventura.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/339aa132aee19ced825e32e534324ac7fddc1948efbf19216760c835d71c395b--openssl@1.1-1.1.1t.arm64_ventura.bottle.tar.gz
- ==> Fetching readline
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/readline-8.2.1.arm64_ventura.bottle.tar.gz
- Already downloaded: /Users/mark/Library/Caches/Homebrew/downloads/61eadcc12bccc526220de0af71471c1f84d36861ce68a1e85979887e904b4e56--readline-8.2.1.arm64_ventura.bottle.tar.gz
- ==> Fetching ruby
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/ruby-3.2.2.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Fetching cocoapods
- ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/cocoapods-1.12.1.arm64_ventura.bottle.tar.gz
- ##################################################################################################################################################################################################### 100.0%
- ==> Installing dependencies for cocoapods: libyaml, ca-certificates, openssl@1.1, readline and ruby
- ==> Installing cocoapods dependency: libyaml
- ==> Pouring libyaml-0.2.5.arm64_ventura.bottle.tar.gz
- 声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/426466推荐阅读
相关标签
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。