Closed4

asdf上のRustでインストールしたクレートにパスが通らない

ピン留めされたアイテム
hawkk9hawkk9

解決

以下で解決した。

$ asdf reshim rust

asdfのshimが再作成されてtrunkが実行できるようになった。

$ ls $HOME/.asdf/shims/ | grep trunk
trunk

$ trunk -v
trunk 0.16.0
hawkk9hawkk9

Rustをインストール

$ asdf plugin add rust
$ asdf install rust latest
$ asdf global rust latest
hawkk9hawkk9

trunkクレートをインストール&実行

インストール

$ cargo install trunk

実行

コマンドが見つからない(パスが通ってない)

$ trunk
fish: Unknown command: trunk
hawkk9hawkk9

調査

trunkコマンドは $HOME/.asdf/installs/rust/1.70.0/bin に存在するっぽい。

$ ls $HOME/.asdf/installs/rust/1.70.0/bin | grep trunk
trunk

cargo install trunk 時に出てた以下を実行する必要がある?

Rust is installed now. Great!

To get started you need Cargo's bin directory
($HOME/.asdf/installs/rust/1.70.0/bin) in your PATH
environment variable. This has not been done automatically.

To configure your current shell, run:
source "$HOME/.asdf/installs/rust/1.70.0/env"

asdf-rustプラグインのREADMEAfter you have installed rust, do NOT follow the directions it outputs to update your PATH -- asdf's shim will handle that for you! とあるので違う気がする。

このスクラップは2023/06/24にクローズされました