본문 바로가기
Programming/Rust

Rust 시작해보기 (rustup 설치) - mingw 버전

by 가우리언 2025. 11. 15.
728x90
반응형

먼저 scoop 을 설치합니다. PowerShell 에서 다음을 실행합니다.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

scoop 을 이용해서, mingw (GNU C++) 을 설치합니다.

> scoop install mingw

scoop 을 이용해서 rustup-gnu 를 설치합니다.

> scoop install main/rustup-gnu

이제 rustc --version 을 실행해서 Rust 설치가 잘 되었는지 확인합니다.

D:\work>rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14)

그리고, 프로젝트를 여러개 관리하다보면, rust 의 버전을 여러가지를 써야만 하는 경우가 있을 수 있어요. rustup 은 여러개의 rust 버전을 관리할 수 있도록 만들어져 있습니다. 터미널에서 rustup toolchain list 라고 입력해봅시다.

D:\work>rustup toolchain list
stable-x86_64-pc-windows-gnu (active, default)

그러면, stable-x86_64-pc-windows-gnu 라는 것이 default 로 선택되어 있는 것을 볼 수 있을 것입니다. 이것은 rust 의 최신버전이 선택되어 있음을 의미합니다. 만약 rust 1.77.0 버전을 추가하기를 원하면, rustup toolchain install 1.77.0 을 실행하면 됩니다.

D:\work>rustup toolchain list
stable-x86_64-pc-windows-gnu (active, default)

D:\work>rustup toolchain install 1.77.0
info: syncing channel updates for '1.77.0-x86_64-pc-windows-gnu'
info: latest update on 2024-03-21, rust version 1.77.0 (aedd173a2 2024-03-17)
info: downloading component 'cargo'
 10.0 MiB /  10.0 MiB (100 %)   4.8 MiB/s in  3s
info: downloading component 'clippy'
  3.4 MiB /   3.4 MiB (100 %)   2.8 MiB/s in  1s
info: downloading component 'rust-docs'
 14.9 MiB /  14.9 MiB (100 %)   4.1 MiB/s in  4s
info: downloading component 'rust-mingw'
  4.7 MiB /   4.7 MiB (100 %)   2.9 MiB/s in  1s
info: downloading component 'rust-std'
 22.5 MiB /  22.5 MiB (100 %)   4.4 MiB/s in  5s
info: downloading component 'rustc'
 71.4 MiB /  71.4 MiB (100 %)   4.3 MiB/s in 16s
info: downloading component 'rustfmt'
  3.2 MiB /   3.2 MiB (100 %)   2.7 MiB/s in  1s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 14.9 MiB /  14.9 MiB (100 %)   2.1 MiB/s in  5s
info: installing component 'rust-mingw'
info: installing component 'rust-std'
 22.5 MiB /  22.5 MiB (100 %)  20.8 MiB/s in  1s
info: installing component 'rustc'
 71.4 MiB /  71.4 MiB (100 %)  21.0 MiB/s in  3s
info: installing component 'rustfmt'

  1.77.0-x86_64-pc-windows-gnu installed - rustc 1.77.0 (aedd173a2 2024-03-17)

info: checking for self-update

다시, rustup toolchain list 를 입력해 보시지요.

D:\work>rustup toolchain list
stable-x86_64-pc-windows-gnu (active, default)
1.77.0-x86_64-pc-windows-gnu

1.77.0 버전이 추가된 것을 확인할 수 있습니다. 그렇지만, default 로 선택되어 있지 않아요. rustup default 1.77.0 을 입력해주면, 새로 설치한 1.77.0 을 사용할 수 있게 됩니다.

D:\work>rustup default 1.77.0
info: using existing install for '1.77.0-x86_64-pc-windows-gnu'
info: default toolchain set to '1.77.0-x86_64-pc-windows-gnu'

  1.77.0-x86_64-pc-windows-gnu unchanged - rustc 1.77.0 (aedd173a2 2024-03-17)


D:\work>rustup toolchain list
stable-x86_64-pc-windows-gnu
1.77.0-x86_64-pc-windows-gnu (active, default)

rustup default stable 을 입력하면, 다시 최신 버전의 rust 를 사용할 수 있습니다.

D:\work>rustup default stable
info: using existing install for 'stable-x86_64-pc-windows-gnu'
info: default toolchain set to 'stable-x86_64-pc-windows-gnu'

  stable-x86_64-pc-windows-gnu unchanged - rustc 1.90.0 (1159e78c4 2025-09-14)


D:\work>rustup toolchain list
stable-x86_64-pc-windows-gnu (active, default)
1.77.0-x86_64-pc-windows-gnu

D:\work>rustc --version
rustc 1.90.0 (1159e78c4 2025-09-14)
728x90
반응형