2026/07/07(火) [n年前の日記]
#2 [rust] RustをWindows11にインストールしておいた
プログラミング言語の Rust を Windows11 x64 25H2 にインストールしておいた。今回は Rust 1.96.1 がインストールされた。
一旦 rustup self uninstall でアンインストールしてから、rustup-init.exe を実行してインストールした。
作業手順については以前メモしてあった。
_mieki256's diary - Rustで使えるGUIライブラリを調べてる
_mieki256's diary - RustをWindows10にインストール
_mieki256's diary - RustをWindows10にインストール
利用するには C++コンパイラが必要らしいけど、Visual Studio Community 2022 をインストールしてある環境だからそのあたりはクリアしているだろう…。たぶん。
インストール場所を変更したいので、環境変数を指定しておく。事前に環境変数を指定しておくと、その場所にインストールしてくれるらしい。
入手した rustup-init.exe 64bit版を実行すると以下のメッセージが表示された。
1を選択してインストール処理を進める。色々なファイルがダウンロードされてインストールされていく。
rustc 1.96.1 がインストールされた、と表示された。
Enterを叩けばコンソールが終了して、環境変数PATHに cargo関連ツールのパスが追加される。ユーザ側の環境変数 PATH に追加された模様。追加というか、PATH の一番最初に挿入されてるけれど…。
インストール場所やバージョンを確認。
一旦 rustup self uninstall でアンインストールしてから、rustup-init.exe を実行してインストールした。
作業手順については以前メモしてあった。
_mieki256's diary - Rustで使えるGUIライブラリを調べてる
_mieki256's diary - RustをWindows10にインストール
_mieki256's diary - RustをWindows10にインストール
利用するには C++コンパイラが必要らしいけど、Visual Studio Community 2022 をインストールしてある環境だからそのあたりはクリアしているだろう…。たぶん。
インストール場所を変更したいので、環境変数を指定しておく。事前に環境変数を指定しておくと、その場所にインストールしてくれるらしい。
- CARGO_HOME : cargo のインストール場所のパスを指定。今回は D:\Rust\.cargo にした。
- RUSTUP_HOME : rustupのインストール場所のパスを指定。今回は D:\Rust\.rustup にした。
入手した rustup-init.exe 64bit版を実行すると以下のメッセージが表示された。
warn: It looks like you have an existing rustup settings file at:
warn: D:\Rust\.rustup\settings.toml
warn: Rustup will install the default toolchain as specified in the settings file,
warn: instead of the one inferred from the default host triple.
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:
D:\Rust\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
D:\Rust\.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:
D:\Rust\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the PATH registry key at HKEY_CURRENT_USER\Environment.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
urrent installation options:
default host triple: x86_64-pc-windows-msvc
default toolchain: stable (default)
profile: default
modify PATH variable: yes
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation
>
1を選択してインストール処理を進める。色々なファイルがダウンロードされてインストールされていく。
rustc 1.96.1 がインストールされた、と表示された。
Rust is installed now. Great! To get started you may need to restart your current shell. This would reload its PATH environment variable to include Cargo's bin directory (D:\Rust\.cargo\bin). Press the Enter key to continue.
Enterを叩けばコンソールが終了して、環境変数PATHに cargo関連ツールのパスが追加される。ユーザ側の環境変数 PATH に追加された模様。追加というか、PATH の一番最初に挿入されてるけれど…。
インストール場所やバージョンを確認。
> where cargo D:\Rust\.cargo\bin\cargo.exe > where rustup D:\Rust\.cargo\bin\rustup.exe > cargo --version cargo 1.96.1 (356927216 2026-06-26) > rustup --version rustup 1.29.0 (28d1352db 2026-03-05) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: the currently active `rustc` version is `rustc 1.96.1 (31fca3adb 2026-06-26)`
[ ツッコむ ]
以上です。