我downloaded rustup-init.exe .当我在家里运行它时,一切都很好,但是当我通过代理从我的办公室运行它时,我遇到了一个问题:
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\350627\.rustup\tmp\l3ogei4e89gnb1df_file
info: caused by: error during download
info: caused by: [6] Couldn't resolve host name (Couldn't resolve host 'static.rust-lang.org')
我在 Windows 上并且正确设置了 http_proxy
环境变量。
我尝试“自定义安装”,但没有给我手动提供 IP 地址的选项:
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
有人知道解决方法吗?
最佳答案
我听从了 aSpex 的建议...
- 转到 https://www.rust-lang.org/ -> 安装
下载 rustup-init.exe 到 ~/Downloads
在 powershell 中:
$proxy='http://<IP>:<PORT>' $ENV:HTTP_PROXY=$proxy $ENV:HTTPS_PROXY=$proxy cd ~\Downloads .\rustup-init.exe
关于proxy - 在防火墙后面时,如何在 Windows 上使用 rustup 安装 Rust?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42843329/