在Linux下配置Rust编译器,你需要遵循以下步骤:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
这将下载并运行Rustup安装脚本。按照提示操作,完成安装过程。
~/.bashrc
(或~/.zshrc
,取决于你使用的shell)文件中:source $HOME/.cargo/env
保存文件并运行以下命令,使更改生效:
source ~/.bashrc
rustc --version
如果看到Rust编译器的版本号,说明安装成功。
rustup update
现在你已经成功配置了Rust编译器,可以开始使用它来编译和运行Rust程序了。