Notice
Recent Posts
Recent Comments
Link
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
반응형
Archives
Today
Total
관리 메뉴

슈프림 블로그

[CocoaPods] 1년만에 코코아팟을 사용하니 생긴 문제 - 해결 본문

iOS_Swift

[CocoaPods] 1년만에 코코아팟을 사용하니 생긴 문제 - 해결

_슈프림 2023. 2. 23. 16:49
728x90

아주 긴 여정의 시작.....

 

1. CocoaPods 버전 업데이트 실패

오랜만에 사이드 프로젝트를 켰는데,,,,

띠용 pod install이 안되는거다.

팀원보다 CocoaPods 마이너버전이 3이나 차이나네ㅋㅋㅋ 그동안 너무 사이드 프로젝트를 안했군...

음 버전을 똑같이 맞춰야겠다! 하고 업데이트 했더니

sudo gem install cocoapods -v 1.11.3

mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

 

 

2. 개발자도구 설치

루비 개발자도구를 설치하라네??

xcode-select --install 명령어를 치면 알아서 개발자도구 설치를 쭉쭉 진행해준다.

xcode-select --install

설치 한 뒤에 다시 코코아팟을 설치하려고 하니 똑같은 에러가 발생했다ㅠㅠ

sudo gem install cocoapods -v 1.11.3
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

 

3. homebrew 업데이트 / brew install cocoapods

ruby gem이 안되는건가.. 그렇다면 포기하고 homebrew로 설치해보자.

brew install cocoapods

왜 잘 되던 homebrew까지 말썽인지.. 킹받는군...

아무튼 에러메세지가 시키는 대로 해보자.

To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
These commands may take a few minutes to run due to the large size of the repositories.

적혀있는대로 정말 오래걸린다ㅋㅋㅋ 이거 돌려놓고 샤워하고 옴..

 

이제 진짜로 다시 homebrew로 코코아팟 설치하기!!!

brew install cocoapods

오!! 뭔가 되긴 됐는데 중간에 에러가 살짜쿵 거슬린다.

 

4. brew link 충돌

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/xcodeproj
Target /usr/local/bin/xcodeproj
already exists. You may want to remove it:
  rm '/usr/local/bin/xcodeproj'

To force the link and overwrite all conflicting files:
  brew link --overwrite cocoapods

To list all files that would be deleted:
  brew link --overwrite --dry-run cocoapods

Possible conflicting files are:
/usr/local/bin/xcodeproj

파일 충돌이 일어난듯 한데, 강제로 덮어쓰기 하는 방식으로 해결해보았다.

 

5. 성공!!!!!!

이제 진짜 pod install을 실행해보면?!

돌고돌아 해결!!!ㅠㅠㅠㅠㅜㅜㅜㅜㅜㅜ

반응형
Comments