Rust是一门系统编程语言,专注于安全,尤其是并发安全,支持函数式和命令式以及泛型等编程范式的多范式语言。
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
info: downloading installer
Welcome to Rust!
This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.
Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:
/Users/***/.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
/Users/***/.cargo
This can be modified with the CARGO_HOME environment variable.
The cargo, rustc, rustup and other commands will be added to
Cargo's bin directory, located at:
/Users/***/.cargo/bin
This path will then be added to your PATH environment variable by
modifying the profile files located at:
/Users/***/.profile
/Users/***/.bash_profile
/Users/***/.zshenv
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: aarch64-apple-darwin
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>
error: could not amend shell profile: '/Users/***/.profile': could not write rcfile file: '/Users/***/.profile': Permission denied (os error 13)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --no-modify-path
info: downloading installer
info: profile set to 'default'
info: default host triple is aarch64-apple-darwin
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2024-02-08, rust version 1.76.0 (07dca489a 2024-02-04)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
14.7 MiB / 14.7 MiB (100 %) 8.4 MiB/s in 1s ETA: 0s
info: downloading component 'rust-std'
24.3 MiB / 24.3 MiB (100 %) 9.3 MiB/s in 3s ETA: 0s
info: downloading component 'rustc'
54.7 MiB / 54.7 MiB (100 %) 10.2 MiB/s in 5s ETA: 0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
14.7 MiB / 14.7 MiB (100 %) 5.7 MiB/s in 1s ETA: 0s
info: installing component 'rust-std'
24.3 MiB / 24.3 MiB (100 %) 19.8 MiB/s in 1s ETA: 0s
info: installing component 'rustc'
54.7 MiB / 54.7 MiB (100 %) 21.7 MiB/s in 2s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-aarch64-apple-darwin'
stable-aarch64-apple-darwin installed - rustc 1.76.0 (07dca489a 2024-02-04)
Rust is installed now. Great!
To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. This has not been done automatically.
To configure your current shell, run:
source "$HOME/.cargo/env"
rustc -V
rustc 1.76.0 (07dca489a 2024-02-04)
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
curl: (6) Could not resolve host: sh.rustup.rs
brew install rustup-init
rustup-init