homebrewではなく、ターミナルから直接Rustのインストール用のshellファイルをダウンロードして実行する
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/ユーザー名/.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory 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/ユーザー名/.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を選ぶ
以下のコマンドがインストールされる
cargo
cargo-clippy
cargo-fmt
cargo-miri
clippy-driver
rls
rust-gdb
rust-lldb
rustc
rustdoc
rustfmt
rustup
Rustの環境設定 | 説明 |
---|---|
$HOME/.rustup |
rustupのメタデータとツールチェーンがインストールされる |
$HOME/.cargo |
cargoで使えるバイナリと環境設定が入っている |
$HOME/.cargo/bin |
cargo, rustc, rustupなどのコマンドが入る |
$HOME/.profile $HOME/.zshenv |
cargoなどのコマンドが使えるように PATH 環境変数の読み込み用のファイル |
rustup self uninstall