Symptoms
于是参考一些博客尝试修改Rust Crates的mirror,在 $HOME/.cargo/config
中添加如下内容,重新cargo install simple-http-server
依然不行
Cause
潜在默认的索引地址是https://github.com/rust-lang/crates.io-index
Resolution
官方的rust镜像配置了$CARGO_HOME环境变量,参看官方网站,配置文件写入$CARGO_HOME/config.toml再次调用发现mirror就生效了
ref
- https://mirrors.ustc.edu.cn/help/crates.io-index.html
- https://mirrors.tuna.tsinghua.edu.cn/help/crates.io-index.git/
- https://doc.rust-lang.org/cargo/reference/config.html
- https://doc.rust-lang.org/cargo/reference/source-replacement.html