公式の手順にした。
curl -sSf https://static.rust-lang.org/rustup.sh | sh
他では
curl -sf -L https://static.rust-lang.org/rustup.sh | sh
だったり、大文字Sが無かったりだが
-S, --show-error Show error. With -s, make curl show errors when they occur
エラー表示用だ。
qiita.com このような入れ方もあるが2年前の記事なので辞めた。
バージョン確認
rustc --version
僕はc
を忘れて
rust --version
とやって、入ってないのかと何度も入れててハマった。
あとは公式のHello World
$があるので以下コピペするのが楽。
mkdir ~/projects cd ~/projects mkdir hello_world cd hello_world
main.rs
fn main() { println!("Hello, world!"); }
rustc main.rs
実行
./main