LoginSignup
0
0

fishでRustをインストールする

Posted at

インストール

途中でオプションを聞かれるが、とりあえず1を選べばいいと思う。

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
...
Current installation options:


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

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1
...
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

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

PATHを通す

$ source "$HOME/.cargo/env"
~/.cargo/env (line 4): 'case' builtin not inside of switch block
case ":${PATH}:" in
^~~^
from sourcing file ~/.cargo/env
source: Error while reading file '/Users/kotaro/.cargo/env'

素直にsource "$HOME/.cargo/env"を実行するとエラーになるが要はPATHさえ通れば良いので、fish_add_pathを実行すれば良い。

$ fish_add_path $HOME/.cargo/bin
$ rustc -V
rustc 1.75.0 (82e1608df 2023-12-21)

参考

https://doc.rust-lang.org/book/ch01-01-installation.html
https://github.com/rust-lang/rustup/issues/478#issuecomment-1288194464

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0