❯ pod install[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.jsonAnalyzing dependenciesFetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`[Codegen] Found FBReactNativeSpecFetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x00000001022ec000어쩌다가 React Native를 하게 되어 ios 디렉터리에서 pod install 을 실행하였는데, 이상한 오류가 발생하였다.
실행 환경은 M1 Macbook Pro (2020), macOS Monterey 12.3.1에서 발생하였다.
해결법
아키텍쳐 관련 문제인 것으로 보이는데, homebrew 버전의 cocoapods은 해당 문제가 해결된 것으로 보인다.
# gem으로 설치한 cocoapods 삭제sudo gem uninstall cocoapods
# homebrew에서 cocoapods 설치brew install cocoapods혹은 다른 해결법
예전에 M1 대응이 어려웠을 때 이용했던 방법이며, 현재는 cocoapods에서는 권장하지 않고 있다. 아키텍쳐 문제가 발생하는 경우에만 사용하자.
arch 명령어를 이용하여 x86_64 아키텍쳐로 gem을 실행한다. 따라서 로제타2가 머신에 깔려 있어야 동작한다.
softwareupdate --install-rosettasudo arch -x86_64 gem install ffi다만 cocoapods에서는 해당 명령어를 이용하여 pod install을 하지 말라고 안내하고 있다.
[!] Do not use "pod install" from inside Rosetta2 (x86_64 emulation on arm64).
[!] - Emulated x86_64 is slower than native arm64
[!] - May result in mixed architectures in rubygems (eg: ffi_c.bundle files may be x86_64 with an arm64 interpreter)
[!] Run "env /usr/bin/arch -arm64 /bin/bash --login" then try again.arch -x86_64 pod install안내
해당 글은 '도다 Aha!'에서 이전된 글입니다. 이전 글과 달라진 부분이 있을 수 있습니다.
태그
ios
•
react-native
반응과 댓글 시스템은 Giscus에 의해 호스팅되며, 모든 대화는 GitHub에 저장됩니다.