cocoapods 설치

2023. 10. 18. 02:42Programming/Swift


$ 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.16.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 ./siteconf20231018-31509-1t1qqqx.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.

Provided configuration options:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
from extconf.rb:10:in `system_libffi_usable?'
from extconf.rb:46:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:


extconf failed, exit code 1

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


# 아래 링크 참조


Install Ruby On Rails on macOS 10.11 El Capitan | GoRails - GoRails

A guide to setting up a Ruby on Rails development environment on macOS 10.11 El Capitan with Git, MySQL, and PostgreSQL

1. brew 설치

$ /bin/bash -c "$(curl -fsSL"


2. brew Path 지정

$ echo 'source ~/.bash_profile' >> ~/.zshrc

$ echo 'export PATH=/opt/homebrew/bin:$PATH' >> ~/.zshrc

$ source ~/.zshrc


3. ruby 설치

$ cd
$ git clone ~/.asdf

$ vi ~/.zshrc


$ echo 'legacy_version_file = yes' >> ~/.asdfrc
$ exec $SHELL


$ asdf plugin add ruby
$ asdf plugin add nodejs


$ brew install rbenv ruby-build

$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
$ source ~/.bash_profile


$ source ~/.zshrc

/Users/goodgods/.zshrc:5: permission denied: /Users/goodgods/.asdf/
/Users/goodgods/.zshrc:6: permission denied: /Users/goodgods/.asdf/completions/asdf.bash

$ chmod 755 /Users/goodgods/.asdf/

$ chmod 755 /Users/goodgods/.asdf/completions/asdf.bash


$ asdf install ruby 3.2.2

To follow progress, use 'tail -f /var/folders/4n/jmhh9dq501q3h4x0xbvhz8gc0000gn/T/ruby-build.20231018013346.97385.log' or pass --verbose
Downloading openssl-3.1.3.tar.gz...
Installing openssl-3.1.3...
Installed openssl-3.1.3 to /Users/goodgods/.asdf/installs/ruby/3.2.2

Downloading ruby-3.2.2.tar.gz...
Installing ruby-3.2.2...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
Installed ruby-3.2.2 to /Users/goodgods/.asdf/installs/ruby/3.2.2

$ asdf global ruby 3.2.2


$ sudo gem update --system

Updating rubygems-update
Fetching rubygems-update-3.4.21.gem
Successfully installed rubygems-update-3.4.21
Parsing documentation for rubygems-update-3.4.21
Installing ri documentation for rubygems-update-3.4.21
Done installing documentation for rubygems-update after 0 seconds
Parsing documentation for rubygems-update-3.4.21
Done installing documentation for rubygems-update after 0 seconds
Installing RubyGems 3.4.21
  Successfully built RubyGem
  Name: bundler
  Version: 2.4.21
  File: bundler-2.4.21.gem
Bundler 2.4.21 installed
RubyGems 3.4.21 installed
Regenerating binstubs
Regenerating plugins
Parsing documentation for rubygems-3.4.21
Installing ri documentation for rubygems-3.4.21

# 3.4.21 / 2023-10-17

## Enhancements:

* Abort `setup.rb` if Ruby is too old. Pull request
  [#7011]( by
* Remove usage of Dir.chdir that only execute a subprocess. Pull request
  [#6930]( by segiddins
* Freeze more strings in generated gemspecs. Pull request
  [#6974]( by segiddins
* Use pure-ruby YAML parser for loading configuration at RubyGems. Pull
  request [#6615]( by hsbt
* Installs bundler 2.4.21 as a default gem.

## Documentation:

* Update suggested variable for bindir. Pull request
  [#7028]( by hsbt
* Fix invalid links in documentation. Pull request
  [#7008]( by simi

# 3.4.20 / 2023-09-27

## Enhancements:

* Raise `Gem::Package::FormatError` when gem encounters corrupt EOF.
  Pull request [#6882](
  by martinemde
* Allow skipping empty license `gem build` warning by setting license to
  `nil`. Pull request
  [#6879]( by jhong97
* Update SPDX license list as of 2023-06-18. Pull request
  [#6891]( by
* Update SPDX license list as of 2023-04-28. Pull request
  [#6642]( by segiddins
* Update SPDX license list as of 2023-01-26. Pull request
  [#6310]( by segiddins
* Installs bundler 2.4.20 as a default gem.

## Bug fixes:

* Fixed false positive SymlinkError in symbolic link directory. Pull
  request [#6947]( by
* Ensure that loading multiple gemspecs with legacy YAML class references
  does not warn. Pull request
  [#6889]( by segiddins
* Fix NoMethodError when choosing a too big number from `gem uni` list.
  Pull request [#6901]( by

## Performance:

* Reduce allocations for stub specifications. Pull request
  [#6972]( by segiddins

# 3.4.19 / 2023-08-17

## Enhancements:

* Installs bundler 2.4.19 as a default gem.

## Performance:

* Speedup building docs when updating rubygems. Pull request
  [#6864]( by

# 3.4.18 / 2023-08-02

## Enhancements:

* Add poller to fetch WebAuthn OTP. Pull request
  [#6774]( by jenshenny
* Remove side effects when unmarshaling old `Gem::Specification`. Pull
  request [#6825]( by nobu
* Ship rubygems executables in `exe` folder. Pull request
  [#6704]( by hsbt
* Installs bundler 2.4.18 as a default gem.

# 3.4.17 / 2023-07-14

## Enhancements:

* Installs bundler 2.4.17 as a default gem.

## Performance:

* Avoid unnecessary work for private local gem installation. Pull request
  [#6810]( by

# 3.4.16 / 2023-07-10

## Enhancements:

* Installs bundler 2.4.16 as a default gem.

# 3.4.15 / 2023-06-29

## Enhancements:

* Installs bundler 2.4.15 as a default gem.

## Bug fixes:

* Autoload shellwords when it's needed. Pull request
  [#6734]( by ioquatix

## Documentation:

* Update command to test local gem command changes. Pull request
  [#6761]( by jenshenny

# 3.4.14 / 2023-06-12

## Enhancements:

* Load plugin immediately. Pull request
  [#6673]( by kou
* Installs bundler 2.4.14 as a default gem.

## Documentation:

* Clarify what the `rubygems-update` gem is for, and link to source code
  and guides. Pull request
  [#6710]( by davetron5000

# 3.4.13 / 2023-05-09

## Enhancements:

* Installs bundler 2.4.13 as a default gem.

# 3.4.12 / 2023-04-11

## Enhancements:

* [Experimental] Add WebAuthn Support to the CLI. Pull request
  [#6560]( by jenshenny
* Installs bundler 2.4.12 as a default gem.

# 3.4.11 / 2023-04-10

## Enhancements:

* Installs bundler 2.4.11 as a default gem.


RubyGems installed the following executables:

Ruby Interactive (ri) documentation was installed. ri is kind of like man 
pages for Ruby libraries. You may access it like this:
  ri Classname
  ri Classname.class_method
  ri Classname#instance_method
If you do not wish to install this documentation in the future, use the
--no-document flag, or set it as the default in your ~/.gemrc file. See
'gem help env' for details.

RubyGems system software updated


$ which ruby


$ ruby -v

ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]

$ asdf install nodejs 18.16.1

Cloning node-build...
Downloading node-v18.16.1-darwin-arm64.tar.gz...
Installing node-v18.16.1-darwin-arm64...
Installed node-v18.16.1-darwin-arm64 to /Users/goodgods/.asdf/installs/nodejs/18.16.1

$ asdf global nodejs 18.16.1

$ which node


$ node -v


4. cocoapods 설치

$ sudo gem install cocoapods

Fetching atomos-0.1.3.gem
Fetching CFPropertyList-3.0.6.gem
Fetching colored2-3.1.2.gem
Fetching claide-1.1.0.gem
Fetching nanaimo-0.3.0.gem
Fetching xcodeproj-1.23.0.gem
Fetching ruby-macho-2.5.1.gem
Fetching nap-1.1.0.gem
Fetching molinillo-0.8.0.gem
Fetching gh_inspector-1.1.3.gem
Fetching fourflusher-2.3.1.gem
Fetching escape-0.0.4.gem
Fetching cocoapods-try-1.2.0.gem
Fetching netrc-0.11.0.gem
Fetching cocoapods-trunk-1.6.0.gem
Fetching cocoapods-search-1.0.1.gem
Fetching cocoapods-plugins-1.0.0.gem
Fetching cocoapods-downloader-1.6.3.gem
Fetching cocoapods-deintegrate-1.0.5.gem
Fetching ffi-1.16.3.gem
Fetching ethon-0.16.0.gem
Fetching typhoeus-1.4.0.gem
Fetching public_suffix-4.0.7.gem
Fetching fuzzy_match-2.0.4.gem
Fetching concurrent-ruby-1.2.2.gem
Fetching httpclient-2.8.3.gem
Fetching algoliasearch-1.27.5.gem
Fetching addressable-2.8.5.gem
Fetching tzinfo-2.0.6.gem
Fetching i18n-1.14.1.gem
Fetching connection_pool-2.4.1.gem
Fetching activesupport-7.1.1.gem
Fetching cocoapods-1.13.0.gem
Fetching cocoapods-core-1.13.0.gem
Successfully installed nanaimo-0.3.0
Successfully installed colored2-3.1.2
Successfully installed claide-1.1.0
Successfully installed CFPropertyList-3.0.6
Successfully installed atomos-0.1.3
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed xcodeproj-1.23.0
Successfully installed ruby-macho-2.5.1
Successfully installed nap-1.1.0
Successfully installed molinillo-0.8.0
Successfully installed gh_inspector-1.1.3
Successfully installed fourflusher-2.3.1
Successfully installed escape-0.0.4
Successfully installed cocoapods-try-1.2.0
Successfully installed netrc-0.11.0
Successfully installed cocoapods-trunk-1.6.0
Successfully installed cocoapods-search-1.0.1
Successfully installed cocoapods-plugins-1.0.0
Successfully installed cocoapods-downloader-1.6.3
Successfully installed cocoapods-deintegrate-1.0.5
Building native extensions. This could take a while...
Successfully installed ffi-1.16.3
Successfully installed ethon-0.16.0
Successfully installed typhoeus-1.4.0
Successfully installed public_suffix-4.0.7
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed fuzzy_match-2.0.4
Successfully installed concurrent-ruby-1.2.2
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed httpclient-2.8.3
A new major version is available for Algolia! Please now use the gem to get the latest features.
Successfully installed algoliasearch-1.27.5
Successfully installed addressable-2.8.5
Successfully installed tzinfo-2.0.6
Successfully installed i18n-1.14.1
Successfully installed connection_pool-2.4.1
Successfully installed activesupport-7.1.1
Successfully installed cocoapods-core-1.13.0
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
/Users/goodgods/.asdf/lib/commands/reshim.bash: line 104: /Users/goodgods/.asdf/shims/update_rubygems: Permission denied
Successfully installed cocoapods-1.13.0
Parsing documentation for nanaimo-0.3.0
Installing ri documentation for nanaimo-0.3.0
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for claide-1.1.0
Installing ri documentation for claide-1.1.0
Parsing documentation for CFPropertyList-3.0.6
Installing ri documentation for CFPropertyList-3.0.6
Parsing documentation for atomos-0.1.3
Installing ri documentation for atomos-0.1.3
Parsing documentation for xcodeproj-1.23.0
Installing ri documentation for xcodeproj-1.23.0
Parsing documentation for ruby-macho-2.5.1
Installing ri documentation for ruby-macho-2.5.1
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for molinillo-0.8.0
Installing ri documentation for molinillo-0.8.0
Parsing documentation for gh_inspector-1.1.3
Installing ri documentation for gh_inspector-1.1.3
Parsing documentation for fourflusher-2.3.1
Installing ri documentation for fourflusher-2.3.1
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for cocoapods-try-1.2.0
Installing ri documentation for cocoapods-try-1.2.0
Parsing documentation for netrc-0.11.0
Installing ri documentation for netrc-0.11.0
Parsing documentation for cocoapods-trunk-1.6.0
Installing ri documentation for cocoapods-trunk-1.6.0
Parsing documentation for cocoapods-search-1.0.1
Installing ri documentation for cocoapods-search-1.0.1
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-downloader-1.6.3
Installing ri documentation for cocoapods-downloader-1.6.3
Parsing documentation for cocoapods-deintegrate-1.0.5
Installing ri documentation for cocoapods-deintegrate-1.0.5
Parsing documentation for ffi-1.16.3
Installing ri documentation for ffi-1.16.3
Parsing documentation for ethon-0.16.0
Installing ri documentation for ethon-0.16.0
Parsing documentation for typhoeus-1.4.0
Installing ri documentation for typhoeus-1.4.0
Parsing documentation for public_suffix-4.0.7
Installing ri documentation for public_suffix-4.0.7
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for concurrent-ruby-1.2.2
Installing ri documentation for concurrent-ruby-1.2.2
Parsing documentation for httpclient-2.8.3
Installing ri documentation for httpclient-2.8.3
Parsing documentation for algoliasearch-1.27.5
Installing ri documentation for algoliasearch-1.27.5
Parsing documentation for addressable-2.8.5
Installing ri documentation for addressable-2.8.5
Parsing documentation for tzinfo-2.0.6
Installing ri documentation for tzinfo-2.0.6
Parsing documentation for i18n-1.14.1
Installing ri documentation for i18n-1.14.1
Parsing documentation for connection_pool-2.4.1
Installing ri documentation for connection_pool-2.4.1
Parsing documentation for activesupport-7.1.1
Couldn't find file to include 'activesupport/README.rdoc' from lib/active_support.rb
Installing ri documentation for activesupport-7.1.1
Parsing documentation for cocoapods-core-1.13.0
Installing ri documentation for cocoapods-core-1.13.0
Parsing documentation for cocoapods-1.13.0
Installing ri documentation for cocoapods-1.13.0
Done installing documentation for nanaimo, colored2, claide, CFPropertyList, atomos, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, ffi, ethon, typhoeus, public_suffix, fuzzy_match, concurrent-ruby, httpclient, algoliasearch, addressable, tzinfo, i18n, connection_pool, activesupport, cocoapods-core, cocoapods after 7 seconds
34 gems installed

5. 버전 확인

$ pod -v

/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:108:in `<class:Array>': undefined method `deprecator' for ActiveSupport:Module (NoMethodError)

  deprecate to_default_s: :to_s, deprecator: ActiveSupport.deprecator
Did you mean?  deprecate_constant
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/activesupport-7.1.1/lib/active_support/core_ext/array/conversions.rb:8:in `<top (required)>'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/lib/cocoapods.rb:9:in `<top (required)>'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from <internal:/Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:86:in `require'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/lib/ruby/gems/3.2.0/gems/cocoapods-1.13.0/bin/pod:36:in `<top (required)>'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/bin/pod:25:in `load'
from /Users/goodgods/.asdf/installs/ruby/3.2.2/bin/pod:25:in `<main>'

$ sudo gem uninstall activesupport

You have requested to uninstall the gem:

cocoapods-core-1.13.0 depends on activesupport (>= 5.0, < 8)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]  y
Successfully uninstalled activesupport-7.1.1

$ sudo gem install activesupport -v 7.0.8

Fetching activesupport-7.0.8.gem
Successfully installed activesupport-7.0.8
Parsing documentation for activesupport-7.0.8
Installing ri documentation for activesupport-7.0.8
Done installing documentation for activesupport after 0 seconds
1 gem installed

$ pod --version


$ pod -v

[!] Unknown command: `-v`
Did you mean: env?


    $ pod COMMAND

      CocoaPods, the Cocoa library package manager.


    + cache         Manipulate the CocoaPods cache
    + deintegrate   Deintegrate CocoaPods from your project
    + env           Display pod environment
    + init          Generate a Podfile for the current directory
    + install       Install project dependencies according to versions from a
    + ipc           Inter-process communication
    + lib           Develop pods
    + list          List pods
    + outdated      Show outdated project dependencies
    + plugins       Show available CocoaPods plugins
    + repo          Manage spec-repositories
    + search        Search for pods
    + setup         Set up the CocoaPods environment
    + spec          Manage pod specs
    + trunk         Interact with the CocoaPods API (e.g. publishing new specs)
    + try           Try a Pod!
    + update        Update outdated project dependencies and create new Podfile.lock


    --allow-root    Allows CocoaPods to run as root
    --silent        Show nothing
    --version       Show the version of the tool
    --verbose       Show more debugging information
    --no-ansi       Show output without ANSI codes
    --help          Show help banner of specified command