-
[iOS] CocoaPods 설치오류 해결하기👻 iOS 2021. 1. 6. 23:35
노트북을 바꾸었습니다.
환경설정을 또 다시 해야하네요 ㅠㅠㅠ
cocoapods 설치를 하려고 아래 명령을 호출합니다.
> 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.14.2/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 ./siteconf20210106-1824-1uc5eu.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.14.2 for inspection. Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/ffi-1.14.2/gem_make.out
아 CommendLineTools 를 설치하지 않았네요.
아래 명령을 실행해서 CommendLineTools 설치를 해줍니다.
> xcode-select --install
그리고 다시 설치 시도!
> 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.14.2/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 ./siteconf20210106-1428-19bfktz.rb extconf.rb checking for ffi.h... *** 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.
그런데 본적없는 오류가 나와요;;
찾아보니 해결방법은 CommendLineTools 를 지웠다가 다시 설치하라는데
이것도 해결이 안됩니다.
> sudo rm -rf /Library/Developer/CommandLineTools > xcode-select --install
...
요즘 뭐만 설치했다 하면
이렇게 오류를 많이 만나는지 모르겠네요
이래저래 삽질하다가 아무래도 Ruby 버전이 의심스러워서
설치가능한 2.x 를 찾아보니 2.7.2 가 있어서
설치해 주었습니다.
그리고..
> sudo gem install cocoapods Password: Fetching concurrent-ruby-1.1.7.gem Fetching i18n-1.8.7.gem Fetching thread_safe-0.3.6.gem Fetching tzinfo-1.2.9.gem Fetching activesupport-5.2.4.4.gem Fetching nap-1.1.0.gem Fetching fuzzy_match-2.0.4.gem Fetching httpclient-2.8.3.gem Fetching algoliasearch-1.27.5.gem Fetching ffi-1.14.2.gem
잘 되네요!!!
박슈~~