rust 安装

2021-05-27  本文已影响0人  戈壁堂

安装完成后,.cargo/bin目录包含所有的工具——

rust 安装

➜  ~ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | 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/gebitang/.rustup

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory located at:

  /Users/gebitang/.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/gebitang/.cargo/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

  /Users/gebitang/.profile
  /Users/gebitang/.bash_profile
  /Users/gebitang/.zshenv

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is x86_64-apple-darwin
info: syncing channel updates for 'stable-x86_64-apple-darwin'
672.7 KiB / 672.7 KiB (100 %) 422.6 KiB/s in  1s ETA:  0s
info: latest update on 2021-05-10, rust version 1.52.1 (9bc8c42bb 2021-05-09)
info: downloading component 'cargo'
  4.3 MiB /   4.3 MiB (100 %)   1.4 MiB/s in  3s ETA:  0s
info: downloading component 'clippy'
  1.7 MiB /   1.7 MiB (100 %)   1.6 MiB/s in  1s ETA:  0s
info: downloading component 'rust-docs'
 15.3 MiB /  15.3 MiB (100 %)   1.9 MiB/s in  8s ETA:  0s
info: downloading component 'rust-std'
 23.0 MiB /  23.0 MiB (100 %)   1.9 MiB/s in 13s ETA:  0s
info: downloading component 'rustc'
 58.6 MiB /  58.6 MiB (100 %)   1.9 MiB/s in 32s ETA:  0s
info: downloading component 'rustfmt'
  2.3 MiB /   2.3 MiB (100 %)   1.2 MiB/s in  1s ETA:  0s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 15.3 MiB /  15.3 MiB (100 %)   5.0 MiB/s in  2s ETA:  0s
info: installing component 'rust-std'
 23.0 MiB /  23.0 MiB (100 %)  11.1 MiB/s in  5s ETA:  0s
info: installing component 'rustc'
 58.6 MiB /  58.6 MiB (100 %)  13.8 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-apple-darwin'

  stable-x86_64-apple-darwin installed - rustc 1.52.1 (9bc8c42bb 2021-05-09)


Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source $HOME/.cargo/env

验证

rustc --versioncargo --verson, rustup --version

卸载操作:rustup self uninstall

上一篇 下一篇

猜你喜欢

热点阅读