Rust 프로그래밍 언어 개발 환경 구축 및 Hello World 프로그램 작성 후 실행하기
추천 자료: ASP.NET Core 인증 및 권한 부여
rustup
Windows 환경에서 Rust 설치 실행 파일을 실행하면 아주 손쉽게 Rust 개발 환경을 구축할 수 있습니다.
rustup-init.exe
실행 파일을 실행하면 다음과 같은 형태로 터미널 환경이 실행됩니다.
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:
C:\Users\RedPlus\.rustup
This can be modified with the RUSTUP_HOME environment variable.
The Cargo home directory is located at:
C:\Users\RedPlus\.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:
C:\Users\RedPlus\.cargo\bin
This path will then be added to your PATH environment variable by
modifying the HKEY_CURRENT_USER/Environment/PATH registry key.
You can uninstall at any time with rustup self uninstall and
these changes will be reverted.
Current installation options:
default host triple: x86_64-pc-windows-msvc
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-pc-windows-msvc
warning: Updating existing toolchain, profile choice will be ignored
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2022-11-03, rust version 1.65.0 (897e37553 2022-11-02)
info: downloading component 'rls'
info: downloading component 'rust-src'
info: downloading component 'rust-analysis'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
18.9 MiB / 18.9 MiB (100 %) 11.9 MiB/s in 1s ETA: 0s
info: downloading component 'rust-std'
27.4 MiB / 27.4 MiB (100 %) 11.9 MiB/s in 2s ETA: 0s
info: downloading component 'rustc'
65.0 MiB / 65.0 MiB (100 %) 11.9 MiB/s in 5s ETA: 0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rls'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'rust-analysis'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'rls'
info: installing component 'rust-src'
info: installing component 'rust-analysis'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
18.9 MiB / 18.9 MiB (100 %) 1.5 MiB/s in 8s ETA: 0s
info: installing component 'rust-std'
27.4 MiB / 27.4 MiB (100 %) 9.8 MiB/s in 2s ETA: 0s
info: installing component 'rustc'
65.0 MiB / 65.0 MiB (100 %) 11.3 MiB/s in 5s ETA: 0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable-x86_64-pc-windows-msvc'
stable-x86_64-pc-windows-msvc updated - rustc 1.65.0 (897e37553 2022-11-02) (from rustc 1.59.0 (9d1b2106e 2022-02-23))
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 (%USERPROFILE%\.cargo\bin).
Press the Enter key to continue.
Rust 설치가 완료된 후에는 터미널을 다시 열고 rustup 명령을 실행하면 다음과 같이 관련 정보가 출력이 됩니다.
C:\Users\RedPlus>rustup
rustup 1.25.1 (bb60b1e89 2022-07-12)
The Rust toolchain installer
USAGE:
rustup [FLAGS] [+toolchain] <SUBCOMMAND>
FLAGS:
-v, --verbose Enable verbose output
-q, --quiet Disable progress output
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<+toolchain> release channel (e.g. +stable) or custom toolchain to set override
SUBCOMMANDS:
show Show the active and installed toolchains or profiles
update Update Rust toolchains and rustup
check Check for updates to Rust toolchains and rustup
default Set the default toolchain
toolchain Modify or query the installed toolchains
target Modify a toolchain's supported targets
component Modify a toolchain's installed components
override Modify directory toolchain overrides
run Run a command with an environment configured for a given toolchain
which Display which binary will be run for a given command
doc Open the documentation for the current toolchain
self Modify the rustup installation
set Alter rustup settings
completions Generate tab-completion scripts for your shell
help Prints this message or the help of the given subcommand(s)
DISCUSSION:
Rustup installs The Rust Programming Language from the official
release channels, enabling you to easily switch between stable,
beta, and nightly compilers and keep them updated. It makes
cross-compiling simpler with binary builds of the standard library
for common platforms.
If you are new to Rust consider running `rustup doc --book` to
learn Rust.
C:\Users\RedPlus>
Visual Studio Code 설치
rust-analyzer 설치
동영상 강의(구 강좌)
Rust 프로그래밍 언어 개발 환경 구축 및 Hello World 프로그램 작성 후 실행하기
추천 자료: .NET Blazor에 대해 알아보시겠어요? .NET Blazor 알아보기를 확인해보세요!