Back to tech

asdf でインストールした Flutter が突然認識しなくなったので復活させた

2 min read
Table of Contents
/usr/local/libexec/private/asdf-exec: No such file or directory · Issue #418 · asdf-vm/asdf
github.com
image

突然 asdf でインストールした Flutter が認識しなくなりました。

色々調べたところ、なんとか復帰できたのでメモ程度に書いていきます。

問題

環境

  • OS
    • macOS Monterery 12.0.1
  • Flutter
    • Flutter 2.10.2 • channel stable • https://github.com/flutter/flutter.git Framework • revision 097d3313d8 (3 weeks ago) • 2022-02-18 19:33:08 -0600 Engine • revision a83ed0e5e3 Tools • Dart 2.16.1 • DevTools 2.9.2

問題のエラー

$ flutter create をしたら以下のエラーが出た。

Flutter の path が消えている様子。

hoge@hogehoge ~ % flutter create 
/Users/hoge/.asdf/shims/flutter: line 7: /usr/local/Cellar/asdf/0.8.1_1/libexec/bin/asdf: No such file or directory
/Users/hoge/.asdf/shims/flutter: line 7: exec: /usr/local/Cellar/asdf/0.8.1_1/libexec/bin/asdf: cannot execute: No such file or directory

解決方法

以下のコマンドを打ってshims を生成し直す。

rm -rf ~/.asdf/shims; asdf reshim

参考文献