Search code examples
rubyflutterrubygemscocoapods

CocoaPods not found by Flutter


I have successfully (re)installed them, with

sudo gem uninstall cocoapods && sudo gem install cocoapods

But they are not found by Flutter (flutter doctor keeps giving CocoaPods not installed).

It might be because of two different Ruby versions.

The executable pod is not found indeed...(which pod)

Relevant executables are:

  • ruby 3.1.2 is in /usr/local/opt/ruby/bin/ruby
  • /usr/local/lib/ruby/gems/3.1.0/bin/sandbox-pod.
  • /usr/local/lib/ruby/gems/3.1.0/bin/pod

My Bash setup file has:

# Ruby
export PATH="/usr/local/opt/ruby/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"

Any idea?

Ps: I am on macOS v12 (Monterey)


Solution

  • Installing using Homebrew (executable brew) fixes the issue:

    Remember to run brew link --overwrite cocoapods.