UbuntuにRustをインストールするまでをメモ。
手順
Curlのインストール(インストールされてない場合)
以下のコマンを実行。
curl -I http://www.google.comエラーの場合、事前にインストールする。
sudo apt list curlRustのインストール
Rustupのコマンドでインストール
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shインストール中に以下が表示されたら「1」を選択。
1) Proceed with standard installation (default - just press enter)
2) Customize installation
3) Cancel installation最後に再読み込み
. "$HOME/.cargo/env" 動作確認
任意のディレクトリで
cargo new helloHelloディレクトリに移動して実行。
cd hello
cargo runcd hello
cargo run「Hello, world!」と表示されればOK。
cargo run
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.06s
Running `target/debug/hello`
Hello, world!