title: 'pod init' returns: Operation not permitted - getcwd (Errno::EPERM)
body: <p>When I try perform <code>pod init</code> in my Xcode project directory, it returns the following:</p>
  
  <pre><code>Traceback (most recent call last):
      35: from /usr/local/bin/pod:23:in `&lt;main&gt;'
      34: from /usr/local/bin/pod:23:in `load'
      33: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/bin/pod:36:in `&lt;top (required)&gt;'
      32: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      31: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      30: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods.rb:8:in `&lt;top (required)&gt;'
      29: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      28: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      27: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/string/inflections.rb:1:in `&lt;top (required)&gt;'
      26: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      25: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      24: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/methods.rb:3:in `&lt;top (required)&gt;'
      23: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      22: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      21: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflections.rb:1:in `&lt;top (required)&gt;'
      20: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      19: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      18: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/inflections.rb:3:in `&lt;top (required)&gt;'
      17: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      16: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      15: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/i18n.rb:5:in `&lt;top (required)&gt;'
      14: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      13: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      12: from /Library/Ruby/Gems/2.6.0/gems/i18n-0.9.5/lib/i18n.rb:1:in `&lt;top (required)&gt;'
      11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
       9: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/map.rb:3:in `&lt;top (required)&gt;'
       8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
       7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
       6: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/synchronization.rb:5:in `&lt;top (required)&gt;'
       5: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `load_native_extensions'
       4: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `each'
       3: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `block in load_native_extensions'
       2: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:62:in `try_load_c_extension'
       1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- concurrent/concurrent_ruby_ext (LoadError)
      46: from /usr/local/bin/pod:23:in `&lt;main&gt;'
      45: from /usr/local/bin/pod:23:in `load'
      44: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/bin/pod:36:in `&lt;top (required)&gt;'
      43: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      42: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      41: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.2/lib/cocoapods.rb:8:in `&lt;top (required)&gt;'
      40: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      39: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      38: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/core_ext/string/inflections.rb:1:in `&lt;top (required)&gt;'
      37: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      36: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      35: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/methods.rb:3:in `&lt;top (required)&gt;'
      34: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      33: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      32: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflections.rb:1:in `&lt;top (required)&gt;'
      31: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      30: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      29: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/inflector/inflections.rb:3:in `&lt;top (required)&gt;'
      28: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      27: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      26: from /Library/Ruby/Gems/2.6.0/gems/activesupport-4.2.11.3/lib/active_support/i18n.rb:5:in `&lt;top (required)&gt;'
      25: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      24: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      23: from /Library/Ruby/Gems/2.6.0/gems/i18n-0.9.5/lib/i18n.rb:1:in `&lt;top (required)&gt;'
      22: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      21: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      20: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/map.rb:3:in `&lt;top (required)&gt;'
      19: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      18: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      17: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/synchronization.rb:5:in `&lt;top (required)&gt;'
      16: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `load_native_extensions'
      15: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `each'
      14: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:30:in `block in load_native_extensions'
      13: from /Library/Ruby/Gems/2.6.0/gems/concurrent-ruby-1.1.6/lib/concurrent-ruby/concurrent/utility/native_extension_loader.rb:62:in `try_load_c_extension'
      12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
      11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:123:in `rescue in require'
      10: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:212:in `try_activate'
       9: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1041:in `find_by_path'
       8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1041:in `find'
       7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1041:in `each'
       6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/specification.rb:1042:in `block in find_by_path'
       5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:39:in `compatible?'
       4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:7:in `bundler_version'
       3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:22:in `bundler_version_with_reason'
       2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:68:in `lockfile_version'
       1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in `lockfile_contents'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in `pwd': Operation not permitted - getcwd (Errno::EPERM)
  </code></pre>
  
  <p>I have already installed <code>Homebrew</code>, <code>Ruby</code>, and <code>Cocoapods</code> already. I'm running <code>macOS Catalina 10.15.4</code> and <code>Xcode 11.3.1</code>.</p>
  
  <p>I tried to follow <a href="https://stackoverflow.com/a/32892222">this advice</a> and install cocoapods in <code>/usr/local/bin</code> via the following command: <code>sudo gem install -n /usr/local/bin cocoapods</code> </p>
  
  <p>but I got the same error when installing it: <code>Operation not permitted - getcwd (Errno::EPERM)</code></p>
  
  <p>Any idea what the problem is?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>After reinstalling Ruby manager to install Ruby, I'm getting a new error:</p>
  
  <pre><code>2: from /Users/zorgan/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:9:in `&lt;main&gt;'
      1: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- executable-hooks/hooks (LoadError)
      13: from /Users/zorgan/.rvm/gems/ruby-2.6.5/bin/ruby_executable_hooks:9:in `&lt;main&gt;'
      12: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
      11: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:123:in `rescue in require'
      10: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems.rb:213:in `try_activate'
       9: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1036:in `find_by_path'
       8: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1036:in `find'
       7: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1036:in `each'
       6: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/specification.rb:1037:in `block in find_by_path'
       5: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:39:in `compatible?'
       4: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:7:in `bundler_version'
       3: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:22:in `bundler_version_with_reason'
       2: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:68:in `lockfile_version'
       1: from /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in `lockfile_contents'
  /Users/zorgan/.rvm/rubies/ruby-2.6.5/lib/ruby/site_ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in `pwd': Operation not permitted - getcwd (Errno::EPERM)
  </code></pre>