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.
2
Answers
For MAC M1 chip Users try this solution
install ffi first (if not) In regular terminal using command: sudo arch -x86_64 gem install ffi then arch -x86_64 pod install –repo-update
Run flutter clean
Once complete, rebuild your Flutter application: flutter run
Try to avoid linking with system ruby and download a new ruby version using brew:
Then add this line to .bash_profile or .zshrc
Close the terminal and open it again, then run this line to make sure the default ruby is the newly installed:
Uninstall gem cocoapods and download it using brew