by shigemk2

当面は技術的なことしか書かない

brew install flutter

brew install flutter できるやろと思ったけどhomebrew-coreのFormulaを見たらプルリクで止まっていた。

Mac的には、公式からダウンロードしたzipを解凍して、bin/flutterにパスを通すだけなんだけど、インストールのところで libexec.install Dir["*"] とかしても以下のようなエラーが出た。upgradeするときにgithubから直接pullしているのだ。だから cp_r ".", prefix を実行してディレクトリをまるごとコピーしているみたいだ。

Error: The Flutter directory is not a clone of the GitHub project.
       The flutter tool requires Git in order to operate properly;
       to set up Flutter, run the following command:
       git clone -b stable https://github.com/flutter/flutter.git

cp_r ".", prefix でこの問題をクリアしても、今度はlockfileがpermission deniedになる。たぶんもともとflutterがユーザーベースでの利用を前提としており、システムで一括して使えるように設計されていなかったのが原因と思われる。

Failed to open or create the artifact cache lockfile: "FileSystemException: Cannot open file, path = '/usr/local/Cellar/flutter/stable/bin/cache/lockfile' (OS Error:
Permission denied, errno = 13)"
Please ensure you have permissions to create or open /usr/local/Cellar/flutter/stable/bin/cache/lockfile
Failed to open or create the lockfile

去年のプルリクなので状況は変わっていると思っていたが、今日(1.9.1)でやっても変わらなかった。