While reading the docs, I came across running kdoc...
# getting-started
j
While reading the docs, I came across running kdoctor to check that my environment is set up correctly. I get the following error:
[x] Cocoapods
ruby (ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.x86_64-darwin21])
* System ruby is currently used
Consider installing ruby 2.7 via Homebrew, rvm or other package manager in case of issues with CocoaPods installation
ruby gems (3.0.3.1)
* cocoapods not found
Get cocoapods from <https://guides.cocoapods.org/using/getting-started.html#installation>
I tried what was mentioned for a solution to this but it does not seem to work. Any help is appreciated.
l
Do you use homebrew?
I’d highly recommend using homebrew and installing cocoapods and ruby that way.
j
I do in fact use homebrew. I have homebrew ruby installed and added to path but it does not seem to use the one I want to install cocoapods
l
What output do you get when you try?
Also, did you try brew install cocoapods?
j
So, if I’m not wrong, to install cocoapods is
gem install cocoapods
but when I run this it uses the darwin ruby to install
Also to add, I have used elevated permissions to run the command
l
I set mine up with
brew install cocoapods
with no issues. I’m not sure you want to install cocoapods as root, since that installs it for the root user.
j
I mean that I used sudo but it’s fine. I’ll try using brew to install pods to see how it goes then
l
With some tools, if you use sudo to install, it will install it for the root user only. Not sure about gem.
j
Oh I see but if I don’t use sudo I don’t get the write perms I need to install pods with gem so
One question: Is it possible to uninstall the darwin version of ruby? Then when I install the homebrew ruby, the system should fall back to the brew one no?
Wait nvm it’s not recommended to remove system frameworks
l
Not sure. I’d just install the brew version and leave it be. Last time I touched a system framework, I broke the bootloader.
j
Oh that’s not good. But I mean my whole monterey install is unofficial anyway using OCLP. Anyways, I have both ruby and cocoapods installed but how do I install cocoapods-generator?
Would using the system framework to install it be fine?
l
Are you on 1.7.0 or higher? The cocoapods-generate tool is no longer needed.
*unless you want to use below 1.7.0 in the future
j
1.7.0? For which package are you talking about?
l
1.7.0 of the Kotlin language
j
Uh where can I check this?
j
So I checked Android Studio and I have version 213-1.7.20-release-for-android-studio-AS6777.52 for kotlin
l
What’s in your build.gradle.kts? That’s what will matter. If it’s at least 1.7.0 for all projects, you don’t need cocoapods-generate.
j
Oh it’s 1.7.10
Then I guess I can ignore kdocotor warnings then