๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT-Engineering/TroubleShooting

Something went wrong running `pod install` in the `ios` directory ๋ฌธ์ œ ํ•ด๊ฒฐ ๊ณผ์ • ๊ธฐ๋ก(feat. React Native)

by ๐Ÿงž‍โ™‚๏ธ 2024. 4. 7.
๋ฐ˜์‘ํ˜•

 

์ž‘์—… ์ค‘์— ๋‹ค์Œ์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ios ์—…๋ฐ์ดํŠธ ์ดํ›„ ์ด์ƒํ•˜๊ฒŒ ์—๋Ÿฌ๋“ค์ด ๋งŽ์ด ๋ฐœ์ƒํ•˜๋Š” ๋“ฏํ•˜๋‹ค.

 Something went wrong running `pod install` in the `ios` directory

์ข€ ๋” ๊ธธ๊ฒŒ๋Š” npx ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๋˜ ์ƒํ™ฉ์ด์—ˆ๋‹ค.

npx create-react-native-app
โœ” What is your app named? … my-react-app
โœ” How would you like to start › Default new app
โœ” Downloaded and extracted project files.

Using Yarn to install packages. You can pass --use-npm to use npm instead.

โœ” Installed JavaScript dependencies.
โš ๏ธ  Something went wrong running `pod install` in the `ios` directory. Continuing with initializing the project, you can debug this afterwards.

๋ฌธ์ œ๋ฅผ ์ฐพ์•„๋ณด๋‹ˆ cocoapods๋ผ๋Š” ๋†ˆ์ด ๋ฌธ์ œ๋ผ๊ณ  ํ•œ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ํ•ด๋‹น ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์‹œ ์„ค์น˜ํ•ด์ฃผ์ž.

sudo gem install cocoapods

๋‚ด ๊ฒฝ์šฐ์— ์˜์กด์„ฑ์ด ๋งŽ์ด ๊นจ์ ธ์žˆ์–ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค.

ERROR:  Error installing cocoapods:
    The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
    drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค์‹œ ์•„๋ž˜์˜ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์„ค์น˜ํ–ˆ๋‹ค.

sudo gem install drb -v 2.0.6

๋‹ค์‹œ cocoapods ์„ค์น˜ ๋ช…๋ น์–ด๋ฅผ ์žฌ์‹คํ–‰ํ–ˆ๋‹ค.
๊ทธ๋Ÿฌ๋‚˜, ์ถ”๊ฐ€ ์—๋Ÿฌ ๋ฐœ์ƒ...!

ERROR:  Error installing cocoapods:
    The last version of activesupport (>= 5.0, < 8) to support your Ruby & RubyGems was 6.1.7.7. Try installing it with `gem install activesupport -v 6.1.7.7` and then running the current command again
    activesupport requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.

์ด๋ฒˆ์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋‹ค์‹œ ํŒจํ‚ค์ง€ ์„ค์น˜๋ฅผ ๋‹ค์‹œ ํ–ˆ๋‹ค.

sudo gem install activesupport -v 6.1.7.7

์ดํ›„์— ๋‹ค์‹œ cocodpods๋ฅผ ์„ค์น˜ํ•˜๋‹ˆ ์ •์ƒ ์„ค์น˜ ์™„๋ฃŒ!

์•ž์„œ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ฒผ๋˜ React Native App ํด๋”๋กœ ๋“ค์–ด๊ฐ€์„œ ํ•ด๋‹น ํด๋”๋‚ด์˜ ios ํด๋”๋กœ ๋‹ค์‹œ ์ง„์ž… ํ›„ ์•„๋ž˜์˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ–ˆ๋‹ค.

์–ต,, ๊ทธ๋Ÿฐ๋ฐ ์•„์ง๋„ ์‚ด์ง ๋ฌธ์ œ๊ฐ€ ๋‚จ์•„์žˆ๋‹ค. Xcode ๋ฌธ์ œ๋‹ค.

pod install
Using Expo modules
[Expo] Enabling modular headers for pod ExpoModulesCore
(node:75985) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Framework build type is static library
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
[Codegen] generating an empty RCTThirdPartyFabricComponentsProvider
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`
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
[!] Failed to load 'glog' podspec:
[!] Invalid `glog.podspec` file: undefined method `[]' for nil.

 #  from /Users/sark/dev/react-native/my-react-app/node_modules/react-native/third-party-podspecs/glog.podspec:38
 #  -------------------------------------------
 #    match = xcode_path.match(/Xcode (\d+)\.(\d+)/)
 >    major_version = match[1].to_i
 #    minor_version = match[2].to_i
 #  -------------------------------------------

์ด๋ฒˆ ๋ฌธ์ œ๋Š” ์•„๋ž˜์˜ ๋‘๊ฐ€์ง€ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ํ•ด๊ฒฐ์ด ๋˜์—ˆ๋‹ค.

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

xcode ๊ฒฝ๋กœ๋ฅผ ์ด์™€๊ฐ™์ด ๋‹ค์‹œ ์žก์•„์ค€ ๋’ค์—

xcode-select -p

ํ•ด๋‹น ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ •์ƒ ์ง€์ • ๋˜์—ˆ๋Š”์ง€ ํ™•์ธ์ด ๋œ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ํ™•์ธ์ด ๋  ๊ฒƒ์ด๋‹ค.

/Applications/Xcode.app/Contents/Developer

์ด์ œ ๋‹ค์‹œ pod install์„ ์ˆ˜ํ–‰ํ•˜๋ฉด ์ •์ƒ์ ์œผ๋กœ ์ž˜ ๋  ๊ฒƒ์ด๋‹ค. ๋ฌธ์ œ ํ•ด๊ฒฐ ๋.

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€