
개발 시작 전 Hello World를 출력하듯 KMM 개발을 시작할 때 Kdoctor를 통해 필요한 세팅을 확인합니다. Java, Android Studio, Xcode 설치만 해도 통과할 정도 간단하지만 Mac에 익숙지 않은 유저들은 설치 후 추가 작업이 필요한 CocoaPods에서 어려움을 겪습니다. 🥲
[✖] 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.
에러문구를 보면서 하나씩 해결하는 방법을 소개합니다.
System ruby is currently used CocoaPods is not compatible with system ruby installation on Apple M1 computers
CocoaPods는 Apple Chip을 탑재한 환경에 System Ruby와 호환이 안되서 나타나는 에러입니다.
brew install ruby
homebrew를 사용하여 ruby를 설치합니다.
~/.zshrc 파일에 homebrew로 설치한 ruby의 Path를 설정합니다.
~/.zshrc 파일에 export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.2.2.1/bin:$PATH 문장을 추가합니다.echo "export PATH=/opt/homebrew/opt/ruby/bin:/opt/homebrew/lib/ruby/gems/3.2.2.1/bin:$PATH" >> ~/.zshrccocoapods not found
CocoaPods가 설치되지 않아서 발생하는 에러입니다.
brew install cocoapods
CocoaPods requires your terminal to be using UTF-8 encoding.
만약 CocoaPods를 설치했을 때 위와 같은 에러가 발생한다면 Terminal encoding을 UTF-8로 설정하라는 뜻입니다.
~/.zshrc 파일에 export LC_ALL=en_US.UTF-8 문장을 추가합니다.echo "export LC_ALL=en_US.UTF-8" >> ~/.zshrcEnvironment diagnose (to see all details, use -v option):
[✓] Operation System
[✓] Java
[✓] Android Studio
[✓] Xcode
[✓] Cocoapods
Conclusion:
✓ Your system is ready for Kotlin Multiplatform Mobile Development!
성공적으로 설정을 마쳤습니다!