MacOS에서 Rust 설치하기

Juppi·2024년 9월 11일
0

Rust

목록 보기
1/2

rust는 rustup이라는 Rust 버전 관리 툴 이용해서 설치 할 수 있다.

아래 명령어를 이용해서 rustup을 다운바을 수 있다.

curl https://sh.rustup.rs -sSf | bash -s -- -y --no-modify-path
error: could not amend shell profile: '/Users/juheekang/.bash_profile': could not write rcfile file: '/Users/juheekang/.bash_profile': Permission denied (os error 13)

공식 설치 사이트에 나와있는 명령어를 그대로 사용하면 위처럼 수정 관련 에러가 나기 때문에, --no-modify-path 라는 옵션을 붙여서 실행했다.

아마 기존 명령어는 bash shell 관련 파일을 수정하려는 것 같은데, macos는 디폴트가 zsh라서 나는 에러인 듯 (뇌피셜임)

그리고 ~/.zshrc 파일에 cargo를 PATH에 추가하는 명령어를 입력해주고, source ~/.zshrc 를 통해 활성화하기 !

export PATH="$HOME/.cargo/bin:$PATH"

아래 명령어를 실행했을 때, 잘 뜬다면 설치 rustup 설치 완료 !

rustup --version

reference

https://www.rust-lang.org/tools/install
https://doc.rust-lang.org/book/ch01-01-installation.html
https://github.com/rust-lang/rustup/issues/2040

2개의 댓글

comment-user-thumbnail
2025년 1월 5일

덕분에 설치했습니다 감사합니다 !

1개의 답글