2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutter Doctor の cocoapods でハマった

Last updated at Posted at 2021-02-06

ここだけflutter doctorで出てくる指示通りではうまくいかなかったので、解決した方法をメモしておく。

環境

macOS Catalina v10.15.4
Flutter 1.26.0-17.3.pre
Dart 2.12.0

homebrewをバージョンアップする

brew update

コマンドを実行すると

homebrew-core is a shallow clone.
homebrew-cask is a shallow clone.

という警告が出たので、指示に従って処理を実施した。

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow

その後再びアップデートを実行した。

Rubyをバージョンアップする

brew install ruby

その後は指示に従って諸々のパスを通す

You may want to add this to your PATH.

ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have ruby first in your PATH, run:
  echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/[username]/.bash_profile

For compilers to find ruby you may need to set:
  export LDFLAGS="-L/usr/local/opt/ruby/lib"
  export CPPFLAGS="-I/usr/local/opt/ruby/include"

For pkg-config to find ruby you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

パスを通した後は、.bash_profileを読み込み直すことを忘れずに

source ~/.bash_profile

バージョンが最新になっているか確認する

ruby -v

cocoapods をインストール

sudo gem install -n /usr/local/bin cocoapods

これでiOSエミュレーターでもFlutterアプリを動かせるようになった。

2
2
1

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
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?