[Flutter] CocoaPods Installed But Not Working


1 min read

When running flutter doctor return some weird error about CocoaPods

[!] Xcode - develop for iOS and macOS (Xcode 12.2)
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods. For more info, see https://github.com/flutter/flutter/issues/14293.
      To re-install CocoaPods, run:
        sudo gem install cocoapods
  1. Install Ruby Version Manager (RVM):

    • Open Terminal and run: curl -L https://get.rvm.io | bash -s stable

    • Reopen Terminal to apply changes.

  2. Install Ruby 2.6.5:

    • Run: rvm install ruby-2.6.5
  3. Set Ruby 2.6.5 as Default:

    • Run: rvm use ruby-2.6.5

    • Make it persistent: rvm --default use 2.6.5

  4. Install CocoaPods:

    • Run: sudo gem install cocoapods