skip to Main Content

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


  1. 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

    Login or Signup to reply.
  2. Try to avoid linking with system ruby and download a new ruby version using brew:

    brew install ruby
    

    Then add this line to .bash_profile or .zshrc

    export PATH=/usr/local/opt/ruby/bin:$PATH
    

    Close the terminal and open it again, then run this line to make sure the default ruby is the newly installed:

    which ruby
    

    Uninstall gem cocoapods and download it using brew

    brew install cocoapods
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search