iOS

[iOS] CocoaPods 의존성 설치 문제 해결하기

giop15 2025. 1. 19. 17:37
반응형

문제 상황
`pod install` 명령어 실행 시 다음과 같은 에러가 발생:

undefined method 'request' for nil (NoMethodError)
...
Unable to satisfy the following requirements:
- `ffi (= 1.17.0)` required by `user-specified dependency`


원인 분석
1. Ruby 버전 불일치
2. RubyGems 시스템 업데이트 문제
3. 의존성 충돌
4. CocoaPods 설치 경로 충돌

해결 과정

1. Ruby 버전 확인 및 업데이트

# Ruby 버전 확인
ruby -v

# rbenv를 통해 필요한 Ruby 버전으로 변경
rbenv global

# 변경 확인
ruby -v


2. 의존성 파일 정리

rm -rf Gemfile.lock
rm -rf Pods
rm -rf .bundle


3. Bundle 설치

bundle install


4. FFI Gem 설치

gem install ffi -v "1.17.0"


5. CocoaPods 재설치

# Homebrew를 통해 설치된 CocoaPods 제거
brew uninstall cocoapods

# gem을 통해 CocoaPods 재설치
gem install cocoapods


6. Pod 설치

pod install
반응형