8

When I run Flutter doctor: enter image description here

I have tried to run sudo gem install cocoapods to install it but still the same issue.

Please not that I am running xcode 12 with the newest flutter version in the dev channel.

Any ideas?

Error after running the flutter build:

enter image description here

Nighthawk
  • 772
  • 11
  • 21

4 Answers4

9

What worked for me was to uninstall Cocoapods using sudo gem uninstall cocoapods and using Homebrew instead brew install cocoapods. P.s. I'm using an M1 Macbook.

3

I had the same problem and after hours of looking for a solution, I solved it with these steps: (prerequisites: install homebrew first. To check if installed, in your terminal, type $ brew -v )

  1. $ sudo gem uninstall cocoapods (skip this part if cocoapods is not installed. command $pod --version , will tell you if it's installed or not)
  2. $ brew install cocoapods
  3. If there's an error 'The brew link step did not complete successfully The formula built,........, command $ brew link --overwrite cocoapods
  4. $ brew reinstall cocoapods
  5. $ flutter run

My operating system is macOS Big Sur.

Sharon Atim
  • 1,777
  • 16
  • 12
0

Are you getting an error when you tried to sudo gem install cocoapods? I had to do sudo gem install ruby first to make it work on my Mac.

nicholas
  • 306
  • 2
  • 9
  • Thanks. The error that I am getting after trying to run my flutter app is that CocoaPods is not installed. Please note that I have tried running both sudo gem install cocoapods and sudo gem install ruby. – Nighthawk Sep 30 '20 at 23:49
  • Please see the newly added picture above. – Nighthawk Sep 30 '20 at 23:51
0

In my case the problem was that there was no ruby installation on my mac after a clean install of MacOSX Catalina. So what I did, was first to install Ruby Version Manager with this command:

\curl -sSL https://get.rvm.io | bash -s stable --rails

The RVM installed Ruby on my system along with other dependencies. After that I was able to install cocoapods with the recommended command:

sudo gem install cocoapods

and it worked flawlessly for me after that. Hope this helps. It seems that Apple has removed many developer tools lately from its systems, Ruby being one of them :(

Sta8is
  • 43
  • 7