rustupでRustを導入してみる

rustupでRustを導入してみる

前の記事でrsvmの導入についての記事を書いたが、公式的にはrustupを使うことを推奨しているようなので試してみた

www.rust-lang.org

導入

Rustのページで書かれてるようにコマンドを叩いてみる

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

すると、どのオプションでインストールを実行するのかを確認されるのでとりあえずdefaultを選択してみる

Current installation options:

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

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

インストールが実行される

info: syncing channel updates for 'stable-x86_64-apple-darwin'
info: downloading component 'rustc'
 31.5 MiB /  31.5 MiB (100 %)  23.0 MiB/s ETA:   0 s
info: downloading component 'rust-std'
 41.3 MiB /  41.3 MiB (100 %)  31.9 MiB/s ETA:   0 s
info: downloading component 'cargo'
  3.2 MiB /   3.2 MiB (100 %)   1.3 MiB/s ETA:   0 s
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: default toolchain set to 'stable'

  stable installed - rustc 1.14.0 (e8a012324 2016-12-16)


Rust is installed now. Great!

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

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

そして言われた通りに更新するようコマンドを叩く

$ source $HOME/.cargo/env

入ったかどうかバージョンを確認する

$ rustc -V
rustc 1.14.0 (e8a012324 2016-12-16)

現時点で最新のRustのバージョン1.14.0入った 👍