본문 바로가기
iOS

[환경세팅] 예전 버전 cocoapods 설치 (1.9.1)

by HaningYa 2021. 3. 31.
728x90

 

 

 

macOS 10.15.X에서 이전 1.9.1 cocoapods 설치

처음에  sudo gem install cocoapods -v 1.9.1 했더니 오류뜸

Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

그래서 brew 로 설치해보라고 떠서

  1. brew 설치
  2. brew install cocoapods
  3. 했더니 1.9,1 이 아닌 최신 버전이 설치됨

gem 으로 돌파해야됨.

(참고로 $ sudo xcode-select --install 로 cli 설치해도 안됨)

문제 원인

cocoapods 1.9.1은 내 맥 OS에 설치된 ruby version 에서 지원하지 않음
(아마 macOS를 업데이트 했다면 ruby도 업데이트 되어 문제 발생 안됬을듯)

그래서 ruby를 최신버전으로 업데이트 해줌

 

3.0.0으로 업데이트 시도

 

맥의 ruby를 업데이트 하려면 ruby update 이런걸로 안됨

루비 환경을 맹글어서 시스템 경로를 내가 세팅한 루비로 바꿔야함

  1. brew update
  2. brew install rbenv
  3. rbenv install -l (설치 가능한 버전이 나오는데 나는 3.0.0 했음)
  4. rbenv install 3.0.0
  5. ruby -v (버전 3.0.0인지 확인)

 

설치 완료

 

 

728x90

댓글