install

  1. $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. info: downloading installer
  3. Welcome to Rust!
  4. This will download and install the official compiler for the Rust
  5. programming language, and its package manager, Cargo.
  6. It will add the cargo, rustc, rustup and other commands to
  7. Cargo's bin directory, located at:
  8. /Users/wyb/.cargo/bin
  9. This can be modified with the CARGO_HOME environment variable.
  10. Rustup metadata and toolchains will be installed into the Rustup
  11. home directory, located at:
  12. /Users/wyb/.rustup
  13. This can be modified with the RUSTUP_HOME environment variable.
  14. This path will then be added to your PATH environment variable by
  15. modifying the profile files located at:
  16. /Users/wyb/.profile
  17. /Users/wyb/.bash_profile
  18. You can uninstall at any time with rustup self uninstall and
  19. these changes will be reverted.
  20. Current installation options:
  21. default host triple: x86_64-apple-darwin
  22. default toolchain: stable
  23. profile: default
  24. modify PATH variable: yes
  25. 1) Proceed with installation (default)
  26. 2) Customize installation
  27. 3) Cancel installation
  28. >
  29. info: profile set to 'default'
  30. info: default host triple is x86_64-apple-darwin
  31. info: syncing channel updates for 'stable-x86_64-apple-darwin'
  32. 463.3 KiB / 463.3 KiB (100 %) 383.0 KiB/s in 1s ETA: 0s
  33. info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)
  34. info: downloading component 'cargo'
  35. 3.7 MiB / 3.7 MiB (100 %) 1.7 MiB/s in 2s ETA: 0s
  36. info: downloading component 'clippy'
  37. info: downloading component 'rust-docs'
  38. 12.1 MiB / 12.1 MiB (100 %) 3.4 MiB/s in 4s ETA: 0s
  39. info: downloading component 'rust-std'
  40. 16.1 MiB / 16.1 MiB (100 %) 2.8 MiB/s in 7s ETA: 0s
  41. info: downloading component 'rustc'
  42. 54.5 MiB / 54.5 MiB (100 %) 3.5 MiB/s in 19s ETA: 0s
  43. info: downloading component 'rustfmt'
  44. info: installing component 'cargo'
  45. info: installing component 'clippy'
  46. info: installing component 'rust-docs'
  47. 12.1 MiB / 12.1 MiB (100 %) 4.3 MiB/s in 3s ETA: 0s
  48. info: installing component 'rust-std'
  49. info: installing component 'rustc'
  50. 54.5 MiB / 54.5 MiB (100 %) 11.7 MiB/s in 4s ETA: 0s
  51. info: installing component 'rustfmt'
  52. info: default toolchain set to 'stable'
  53. stable installed - (timeout reading rustc version)
  54. Rust is installed now. Great!
  55. To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
  56. environment variable. Next time you log in this will be done
  57. automatically.
  58. To configure your current shell run source $HOME/.cargo/env
  59. [wolf@LonelyHost: wpcharts]$

version

  1. $ rustc --version

rust 使用国内镜像,快速安装方法