あじちゃんの備忘録。

〜ここはメモ帳です

Rust のインストール

ここに書いてあることを簡略化して書いています。

 

Rustup をインストール

(Rust 1.14.0 以降はインストール方法が変更されて以下になった...とのこと)

$ curl https://sh.rustup.rs -sSf | sh

Welcome to Rust!

...略...

Current installation options:


  default host triple: x86_64-apple-darwin
    default toolchain: stable
              profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>

これが出たら Enter でOK

 

その後このように出るので

Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done
automatically.

 

指示に従いPATH を追加(永続的に設定するには ~/.bash_profile に設定すること)

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

 

追加せずに確認するとこんな感じになる

$ rustic --version
-bash: rustic: command not found

 

「シェルを設定するにはこれを実行してね」って言われるのでする

To configure your current shell run source $HOME/.cargo/env

 

実行する(永続的に設定するには ~/.bash_profile に設定すること)

$ source $HOME/.cargo/env

 

確認する

$ rustc --version
rustc 1.41.0 (5e1a79984 2020-01-27)

Stable版がインストールされる

 

おわり!