1.安裝fundry框架
curl -L https://foundry.paradigm.xyz | bash
2.寫入環境變量
source /Users/xx/.bashrc
3.foundryup
問題1報錯:致命錯誤:無法訪問 'https://github.com/foundry-rs/forge-std
解決方案:
設置hosts文件:
添加指定url的ip地址:
140.82.112.4 github.com
185.199.110.133 raw.githubusercontent.com
199.232.69.194 github.global.ssl.fastly.net
問題2報錯,如何發現命令另一個窗口報錯:報錯zsh: command not found
.bash_profile中修改的環境變量只對當前窗口有效,修改完.bash_profile之後記得在終端輸入source ~/.bash_profile使之生效。
.zshrc在電腦每次自啓時都會生效(永久有效),修改完之後在終端輸入source ~/.zshrc使之生效。
需要在 .zshrc添加環境變量
問題3報錯:
如果在vs code上,命令窗口找不到該命令,重啓項目或者重新安裝插件解決
問題4報錯:
git config --list (查看git配置)
如果發現代理問題,需要刪除代理的git配置
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy