Computer Science/swift ๋ฝ€๊ฐœ๊ธฐ - ์ฐธ๊ณ  ์‚ฌ์ดํŠธ ์ €์žฅ์†Œ

[Pod error] sudo gem install cocoapods ์‹คํ–‰ ์‹œ ์—๋Ÿฌ (ํ•ด๊ฒฐ๋ฒ• ํฌํ•จ)

_cactus 2022. 6. 24. 17:51
๋ฐ˜์‘ํ˜•

sudo gem install cocoapods ์‹คํ–‰ ์‹œ ์—๋Ÿฌ

ERROR: Error installing cocoapods: ERROR: Failed to build gem native extensions

 

sudo gem install cocoapods ์‹œ ERROR log

sudo gem install cocoapods
Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/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 ./siteconf20220621-34945-qb0yrw.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

 

 

 

 

  1. rbenv install -l ๋กœ ์„ค์น˜ ๊ฐ€๋Šฅํ•œ ๋ฒ„์ „ ํ™•์ธ
  2. ๋‚˜๋Š” 2.7 ์ด์ƒ์ด ํ•„์š”ํ–ˆ์Œ
  3. ๋ชฉ๋ก์— 2.7.6 ๋ฐœ๊ฒฌ → rbenv install 2.7.6 ๋กœ ์„ค์น˜
  4. ์„ค์น˜ ํ›„ rbenv versions ๋กœ ๋‚ด ๋ฒ„์ „์ด ์ œ๋Œ€๋กœ ๊น”๋ ธ๋Š”์ง€ ํ™•์ธ
$ rbenv install -l
2.6.10
2.7.6
3.0.4
3.1.2
jruby-9.3.4.0
mruby-3.0.0
rbx-5.0
truffleruby-22.1.0
truffleruby+graalvm-22.1.0

Only latest stable releases for each Ruby implementation are shown.
Use 'rbenv install --list-all / -L' to show all local versions.

$ rbenv install 2.7.6
Downloading openssl-1.1.1n.tar.gz...
-> <https://dqw8nmjcqpjn7.cloudfront.net/40dceb51a4f6a5275bde0e6bf20ef4b91bfc32ed57c0552e2e8e15463372b17a>
Installing openssl-1.1.1n...
Installed openssl-1.1.1n to /Users/###/.rbenv/versions/2.7.6

Downloading ruby-2.7.6.tar.bz2...
-> <https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.6.tar.bz2>
Installing ruby-2.7.6...
ruby-build: using readline from homebrew
Installed ruby-2.7.6 to /Users/###/.rbenv/versions/2.7.6

$ rbenv versions
* system
  2.7.6

 

 

๋ฐ˜์‘ํ˜•
  1. pod ๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•ด ๋ฒ„์ „์„ ํ™•์ธํ•˜๋ ค๊ณ  ํ–ˆ์œผ๋‚˜ pod ๋ช…๋ น์–ด๊ฐ€ ์—†๋‹ค๊ณ  ๋‚˜์˜ด
  2. brew๋ฅผ ์ด์šฉํ•ด์„œ cocoapod๋ฅผ ์„ค์น˜
  3. pod --version ์œผ๋กœ ๋‹ค์‹œ ํ™•์ธํ•ด๋ณด๋‹ˆ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” pod ๋ฒ„์ „์œผ๋กœ ์ž˜ ์„ค์น˜๋จ
$ pod --version 
zsh: command not found: pod

$ brew install cocoapods
 ESC:...skipping...
Warning: Treating cocoapods as a formula. For the cask, use homebrew/cask/cocoapods
cocoapods 1.10.1_1 is already installed but outdated (so it will be upgraded).
==> Downloading <https://ghcr.io/v2/homebrew/core/cocoapods/manifests/1.11.3>
######################################################################## 100.0%
==> Downloading <https://ghcr.io/v2/homebrew/core/cocoapods/blobs/sha256:92ea102a56b7f97ea877b289b92ac7005f10be6ad>
==> Downloading from <https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:92ea102a56b7f97ea877b289b92a>
######################################################################## 100.0%
==> Upgrading cocoapods
  1.10.1_1 -> 1.11.3

==> Pouring cocoapods--1.11.3.monterey.bottle.tar.gz
๐Ÿบ  /usr/local/Cellar/cocoapods/1.11.3: 14,135 files, 29.9MB
==> Running `brew cleanup cocoapods`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /usr/local/Cellar/cocoapods/1.10.1_1... (13,139 files, 30.5MB)

$ pod --version
1.11.3

๐Ÿ™Œ ๐Ÿ™Œ ๐Ÿ™Œ  pod ์„ค์น˜ ์™„๋ฃŒ!!

728x90
๋ฐ˜์‘ํ˜•