Raghav
04/10/2023, 4:53 AM[✖] Cocoapods
✖ System ruby is currently used
CocoaPods is not compatible with system ruby installation on Apple M1 computers.
Please install ruby via Homebrew, rvm, rbenv or other tool and make it default
Detailed information: <https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1/66556339#66556339>
✖ cocoapods not found
Get cocoapods from <https://guides.cocoapods.org/using/getting-started.html#installation>
Conclusion:
✖ KDoctor has diagnosed one or more problems while checking your environment.
Please check the output for problem description and possible solutions.
I followed these instructions from the StackOverflow link mentioned
For Homebrew:
• Execute brew install ruby
• Add export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH
to your .zshrc
(you can find your Homebrew installation directory with $(brew --prefix)
if needed)
• Execute source ~/.zshrc
or restart your shell
• Make sure you are using the correct ruby
binary by executing which ruby
(should be $(brew --prefix)/opt/ruby/bin/ruby
)
• Install CocoaPods with sudo gem install cocoapods
• Make sure you are using the correct pod
binary by executing which pod
(should be $(brew --prefix)/lib/ruby/gems/3.0.0/bin/pod
)
• Make sure ethon
is version 0.13.0 or more with gem info ethon
, otherwise run sudo gem install ethon
• Run pod install
Before adding the path to my .zshrc file, executing which ruby
returned /usr/bin/ruby and (brew --prefix)
returned /usr/local after that I followed the second step
This is the path I added to my .zshrc file
export PATH=/usr/local/opt/homebrew/usr/local/opt/ruby/bin:/usr/local/opt/homebrew/lib/ruby/gems/3.0.0/bin:$PATH
but as I'm running which ruby
in my terminal again it's still showing /usr/bin/ruby but according to the solution it should be (brew --prefix)/opt/ruby/bin/ruby
I have made sure that my .zshrc file is getting updated.
I guess this is the reason of the failure but I may be wrong any tips on resolving this? Thanks
Also I came to know about this channel from the official documentation itselfPablichjenkov
04/10/2023, 6:04 AMPablichjenkov
04/10/2023, 6:06 AMRaghav
04/10/2023, 6:29 AMDave
04/10/2023, 9:10 AMKonstantin Tskhovrebov
04/10/2023, 9:40 AMRaghav
04/10/2023, 9:53 AMRaghav
04/10/2023, 10:15 AMPablichjenkov
04/10/2023, 1:31 PMSam Stone
04/10/2023, 9:28 PMopen /opt/homebrew
and delete all of the files in that folder
• Install homebrew (/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"
).
• Set homebrew path with (echo; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/my_name/.zprofile
and eval "$(/usr/local/bin/brew shellenv)"
• Edit .zshprofile: replace old path to homebrew with /usr/local/Homebrew/bin/brew
so it looked like this (in my .zshprofile, I also set PATH for my Python install and “export PATH”, not sure if that makes a difference) :
eval "$(/usr/local/Homebrew/bin/brew shellenv)"
eval "$(/usr/local/Homebrew/bin/brew shellenv)"
eval "$(/usr/local/bin/brew shellenv)"
eval "$(/usr/local/bin/brew shellenv)"
• Update macOS and xcode command line tools (was behind 2 updates)
• brew install cocoapods
• cd kmm_project/ios
• pod install
Worked like a charm!