m1์นฉ ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ธํŒ… ๊ธฐ๋ก

์šฐ์„  ๊ฐ€์žฅ ๋จผ์ € ์•Œ์•„๋‘˜ ๊ฒƒ์ด ์žˆ๋‹ค.

m1 ์นฉ์€ intel ์นฉ๊ณผ ๋งค์šฐ ๋‹ค๋ฅด๋‹ค.

๊ฐ€์žฅ ํฐ ์ฐจ์ด์ ์€, ํ„ฐ๋ฏธ๋„์„ ๊ทธ๋ƒฅ ์“ธ ์ˆ˜ ์—†๋‹ค๋Š” ๊ฒƒ!

๋‚œ๊ด€ 1. npm install์ด ์•ˆ๋ผ!

๋‚˜๋Š” ์•ฑ๊ฐœ๋ฐœ์ž์ด๊ณ , ์•ฑ์„ ๋นŒ๋“œํ•ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์—
ํ”„๋กœ์ ํŠธ๋ฅผ ์—ด์–ด์„œ node moodules๋ฅผ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด
npm install์„ ์ž…๋ ฅํ–ˆ๋‹ค.
๊ทธ๋Ÿผ ๋‹น์—ฐํ•˜๊ฒŒ๋„ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋œฌ๋‹ค.

env: node: Bad CPU type in executable

์ง„์งœ ๋ง๊ทธ๋Œ€๋กœ Bad CPU์ด๊ธฐ ๋•Œ๋ฌธ!

ํ„ฐ๋ฏธ๋„์— ์ ‘์†ํ•ด์„œ (vsCode terminal์ด๋“  terminal์ด๋“  ์ƒ๊ด€์—†๋‹ค)

softwareupdate --install-rosetta

์ž…๋ ฅ

์ธํ…”๋กœ ๋นŒ๋“œํ•œ ํ”„๋กœ์ ํŠธ๋Š” m1์นฉ๊ณผ๋Š” ํ˜ธํ™˜์ด ๋˜์ง€ ์•Š์•„์„œ,
๊ทธ ๋‘˜์˜ ํ˜ธํ™˜์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•ด์ฃผ๋Š” rosetta๋ฅผ ์„ค์น˜ํ•ด์ฃผ๋ฉด ๋จ
์ด์ œ npm install ์ž…๋ ฅํ•˜๋ฉด ์„ฑ๊ณต.

=> npm install ํ•ด๊ฒฐ!

๋‚œ๊ด€ 2. pod install์ด ์•ˆ๋ผ!

์•ฑ์„ ๋นŒ๋“œํ• ๊ฑฐ๋‹ˆ๊นŒ ios ํด๋”์— ๊ฐ€์„œ pod install์„ ํ•ด์•ผํ•œ๋‹ค.

๊ทธ๋ž˜์„œ ๋Š˜ ํ•˜๋˜๋Œ€๋กœ,

cd ios/ ๋ฅผ ํ•ด์„œ
Pod install์„ ํ–ˆ๋Š”๋ฐ

zsh: command not found: pod

๋ผ๋Š” ์—๋Ÿฌ์™€ ํ•จ๊ป˜ ๋™์ž‘ํ•˜์ง€ ์•Š๋Š”๋‹ค

์™œ?
CocoaPods๊ฐ€ ์„ค์น˜๋˜์ง€ ์•Š์•˜์Œ.

CocoaPods์€?
xCode๋กœ Mac ๊ธฐ๋ฐ˜์˜ ์•ฑ ๊ฐœ๋ฐœ์— ํ•„์š”ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•œ ํ”„๋กœ๊ทธ๋žจ

cocoaPods์„ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด์„œ

sudo gem install cocoapods

์„ ์ž…๋ ฅ

๊ทธ๋Ÿฐ๋ฐโ€ฆ.

Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Fetching molinillo-0.8.0.gem
Fetching cocoapods-core-1.11.2.gem
Fetching xcodeproj-1.21.0.gem
Fetching cocoapods-1.11.2.gem
ERROR:  Error installing cocoapods:
        ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20220120-9131-1jmjw9y.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-21/2.6.0/ffi-1.15.3/gem_make.out

์ด๋Ÿฐ ์—๋Ÿฌ์™€ ํ•จ๊ป˜ ์„ค์น˜๋˜์ง€ ์•Š๋Š”๋‹ค. ์™œ?

CommendLineTools๋ฅผ ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์—.

xcode-select --install

๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋Œ€ํ™”์ƒ์ž๊ฐ€ ๋œจ๋ฉด์„œ ๋ญ”๊ฐ€๋ฅผ ์„ค์น˜ํ•˜๋ผ๊ณ  ํ•œ๋‹ค.
์•ฝ๊ด€์— ๋™์˜ํ•˜๋ฉด ์„ค์น˜๊ฐ€ ์‹œ์ž‘๋œ๋‹ค.
(๋ช‡๋ฐฑ์‹œ๊ฐ„์ด๋ผ๊ณ  ๊ฒ์€ ์ฃผ์ง€๋งŒ M1 ์—์–ด ๊ธฐ์ค€ ์„ค์น˜๋Š” ์•ฝ 10๋ถ„์ •๋„ ๊ฑธ๋ฆฐ๋‹ค)

์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋œ ํ›„

๋‹ค์‹œํ•œ๋ฒˆ

sudo gem install cocoapods

๋ฅผ ์‹คํ–‰ํ–ˆ๋‹ค

๊ทธ๋Ÿฐ๋ฐ๋„ ์•„๊นŒ์™€ ๋˜‘๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋‹ค!
Xcode-select๋ฅผ ์„ค์น˜ํ–ˆ๋Š”๋ฐ ์™œ์ง€?

๊ฒ€์ƒ‰ํ•ด๋ณด๋‹ˆ ๋‹ค์–‘ํ•œ ์ด์œ ์™€ ๋ฐฉ๋ฒ•์ด ์žˆ์—ˆ์ง€๋งŒ,
๋‚˜๋Š” ๊ทธ๋ƒฅ app store์—์„œ xcode๋ฅผ ๊ฒ€์ƒ‰ํ•ด์„œ ์—ฐ ๋’ค์—

sudo gem install cocoapods

์ด ๋ช…๋ น์–ด๋ฅผ ๋‹ค์‹œ ์‹œ๋„ํ•˜๋‹ˆ๊นŒ ๋๋‹ค.

(์•„๋งˆ ์ด์ „ ๋งฅ์—์„œ ์ƒˆ๋กœ์šด ๋งฅ์œผ๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์„ ํ•ด์˜จ ๋’คxcode์— ์ ‘์†ํ•ด์„œ ์„ค์ •์„ ์™„๋ฃŒํ•˜์ง€ ์•Š์•„์„œ ๊ทธ๋Ÿฐ๋“ฏ)

Ignoring ffi-1.15.3 because its extensions are not built. Try: gem pristine ffi --version 1.15.3
Successfully installed cocoapods-core-1.11.2
Successfully installed molinillo-0.8.0
Successfully installed xcodeproj-1.21.0
Successfully installed cocoapods-1.11.2
Parsing documentation for cocoapods-core-1.11.2
Installing ri documentation for cocoapods-core-1.11.2
Parsing documentation for molinillo-0.8.0
Installing ri documentation for molinillo-0.8.0
Parsing documentation for xcodeproj-1.21.0
Installing ri documentation for xcodeproj-1.21.0
Parsing documentation for cocoapods-1.11.2
Installing ri documentation for cocoapods-1.11.2
Done installing documentation for cocoapods-core, molinillo, xcodeproj, cocoapods after 2 seconds
4 gems installed

์ด๊ฒŒ ๋‚˜์˜ค๋ฉด cocoaPods ์„ค์น˜์— ์„ฑ๊ณตํ•œ ๊ฒƒ.

Pod --version

์„ ์ž…๋ ฅํ–ˆ์„ ๋•Œ, ๋ฒ„์ „์ •๋ณด๊ฐ€ ๋‚˜์˜ค๋ฉด ์„ฑ๊ณต

  • oh my z-shellโ€ฆ. ๋‚˜๋Š” ์›๋ž˜ ๋ธŒ๋žœ์น˜๋ช…์„ ๋ฐ”๋กœ ๋ณด๊ธฐ ์œ„ํ•ด์„œ oh my z-shell์„ ์‚ฌ์šฉํ–ˆ๋Š”๋ฐ,
    ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ํ•ด์™”๋Š”๋ฐ๋„ ๊ทธ๋ƒฅ ํด๋”๋ช…๋งŒ ๋‚˜์™€์žˆ์—ˆ๋‹ค.
    ๊ทธ๋ž˜์„œ ์•„ ์•„์ง ์„ค์น˜๊ฐ€ ์•ˆ๋๋‚˜๋ณด๋‹ค~ ํ–ˆ์—ˆ๋Š”๋ฐ
    CommendLineTools์™€ xcode์— ์ฒซ ์ ‘์†ํ•ด์„œ ์„ค์ •์„ ์™„๋ฃŒํ•œ ๋’ค cocoapods์„ ์„ค์น˜ํ•˜๊ณ  ๋‚˜๋‹ˆ
    ์™œ์ธ์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์ง€๋งŒ ๊ธฐ์กด์ฒ˜๋Ÿผ Oh my zshell์ด ์ž˜๋‚˜์˜จ๋‹ค!
    ์•„๋งˆ Oh my zshell์ด ์„ค์น˜๊ฐ€ ๋˜์–ด์žˆ์—ˆ๋Š”๋ฐ, commendLineTools๋ฅผ ์„ค์น˜ํ•ด์„œ ๋ฌด์–ธ๊ฐ€ ์„ค์ •์ด ์™„๋ฃŒ๊ฐ€ ๋œ ๋“ฏํ•˜๋‹ค

์ด์ œ cocoaPods ์„ ์„ค์น˜ํ–ˆ์œผ๋‹ˆ,

cd ios/ ๋กœ ๋“ค์–ด๊ฐ€์„œ pod install์„ ํ•ด์ฃผ์ž

์ด์   ์ž˜ ๋œ๋‹ค.

๋‹ค์‹œ ๋‚˜์™€์„œ npm run ios๋ฅผ ํ•ด์ฃผ๋ฉด ๋นŒ๋“œ ์„ฑ๊ณต!