I install Homebrew. Then I run command "brew install cocoapods". It install successfully but in flutter doctor i got error: cocoapods installed but not working properly. Error because of ruby incompatible version.
Tried another method "sudo gem install cocoapods" and got error:
While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
This is m1 pro 2020 machine.