iOS/정리
[Swift] 코코아팟 정리, 오류 해결
용그무스
2022. 5. 26. 23:55
COCOAPODS
- 외부 라이브러리를 관리하기 위한 의존성 관리 도구
- 다운로드] sudo gem install cocoapods
- pod 파일 생성] 프로젝트 폴더 % pod init
- pod 파일 내용] use_frameworks! 이하 pod 'lb~'
- 라이브러리 다운로드] 프로젝트 폴더 % pod install
- 라이브러리 버전 업데이트] 프로젝트 폴더 % pod update (pod 파일 내용이 수정되었을 때)
- 프로젝트 명.xcworkspace 실행
강의 대로 했는데 워크스페이스는 안생기고 아래 오류 떠서 구글링함...
'/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
출처: https://ondemand.tistory.com/340 [Cloud Computing On Demand:티스토리]
m1이 문제
1. 터미널 Rosetta로 열기 설정 추가
2. ffi 라이브러리 설치 (아키텍쳐를 x86_64 로. 왜인진 이해 못함)
* Ruby-FFI는 다른 언어의 라이브러리를 루비 코드로 실행할 수 있게 해주는 라이브러리
sudo arch -x86_64 gem install ffi
3. pod install 에도 다시
arch -x86_64 pod install
출처: https://ondemand.tistory.com/340 [Cloud Computing On Demand:티스토리]