1. 리액트 네이티브 프로젝트 생성시 에러가 발생
error /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin21/rbconfig.rb:230: warning: Insecure world writable dir /usr/local/lib in PATH, mode 040776
/Library/Ruby/Site/2.6.0/rubygems.rb:264:in find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) from /Library/Ruby/Site/2.6.0/rubygems.rb:283:in
activate_bin_path'
from /usr/bin/bundle:23:in `
위와 같은 에러가 발생 하였다.
cocoapods가 설치 되지 않은 탓 같았다..
프로젝트 디렉토리에서 ios 디렉토리로 이동한 후에 pod install 명령을 실행하여 CocoaPods 의존성을 설치합니다.
ios 폴더로 이동하여 brew install cocoapods
명령어를 실행해 주었다.
터미널 실행 과정
Framework build type is static library
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
[Codegen] Found rncore
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`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[Hermes] Using the release tarball from Maven Central
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
Downloading dependencies
Installing CocoaAsyncSocket (7.6.5)
Installing DoubleConversion (1.1.6)
Installing FBLazyVector (0.72.7)
Installing FBReactNativeSpec (0.72.7)
Installing Flipper (0.182.0)
Installing Flipper-Boost-iOSX (1.76.0.1.11)
Installing Flipper-DoubleConversion (3.2.0.1)
Installing Flipper-Fmt (7.1.7)
Installing Flipper-Folly (2.6.10)
Installing Flipper-Glog (0.5.0.5)
Installing Flipper-PeerTalk (0.0.4)
Installing FlipperKit (0.182.0)
Installing OpenSSL-Universal (1.1.1100)
Installing RCT-Folly (2021.07.22.00)
Installing RCTRequired (0.72.7)
Installing RCTTypeSafety (0.72.7)
Installing React (0.72.7)
Installing React-Codegen (0.72.7)
Installing React-Core (0.72.7)
Installing React-CoreModules (0.72.7)
Installing React-NativeModulesApple (0.72.7)
Installing React-RCTActionSheet (0.72.7)
Installing React-RCTAnimation (0.72.7)
Installing React-RCTAppDelegate (0.72.7)
Installing React-RCTBlob (0.72.7)
Installing React-RCTImage (0.72.7)
Installing React-RCTLinking (0.72.7)
Installing React-RCTNetwork (0.72.7)
Installing React-RCTSettings (0.72.7)
Installing React-RCTText (0.72.7)
Installing React-RCTVibration (0.72.7)
Installing React-callinvoker (0.72.7)
Installing React-cxxreact (0.72.7)
Installing React-debug (0.72.7)
Installing React-hermes (0.72.7)
Installing React-jsi (0.72.7)
Installing React-jsiexecutor (0.72.7)
Installing React-jsinspector (0.72.7)
Installing React-logger (0.72.7)
Installing React-perflogger (0.72.7)
Installing React-rncore (0.72.7)
Installing React-runtimeexecutor (0.72.7)
Installing React-runtimescheduler (0.72.7)
Installing React-utils (0.72.7)
Installing ReactCommon (0.72.7)
Installing SocketRocket (0.6.1)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing hermes-engine (0.72.7)
Installing libevent (2.1.12)
Generating Pods project
Setting REACT_NATIVE build settings
Setting CLANG_CXX_LANGUAGE_STANDARD to c++17 on /Users/nam-yeonhwa/Desktop/frontend_assignment/ios/frontend_assignment.xcodeproj
Pod install took 432 [s] to run
Integrating client project
[!] Please close any current Xcode sessions and use `frontend_assignment.xcworkspace` for this project from now on.
Pod installation complete! There are 63 dependencies from the Podfile and 53 total pods installed.
cocopods를 인스톨 한후에 ios 폴더에서 .xcworkspace 파일을 찾을 수 있었다.
CocoaPods는 iOS 및 macOS 프로젝트에서 쉽게 외부 라이브러리와 종속성을 관리하기 위한 패키지 관리 도구입니다. CocoaPods를 사용하면 프로젝트에 필요한 서드파티 라이브러리를 쉽게 추가하고, 이 라이브러리들 간의 버전 충돌 문제를 해결할 수 있습니다.
이 명령어는 Objective-C 및 스위프트의 라이브러리 관리자 CocoaPods을 통해 npm 또는 yarn으로 설치한 모듈의 네이티브 코드를 프로젝트에 적용해 줍니다.