cocoapods-keys: Cocoapods-keys doesn't work after upgrading to macOS Catalina

I realise using beta software means these sort of issues will come up and generally unsupported; however I am hoping someone can assist me? (maybe its something simple 👍 )

My issue is almost identical to #143

My output is as follows:

---------------------------------------------
Error loading the plugin `cocoapods-keys-2.1.0`.

SystemExit - ERROR: Can't find header dir for ruby. Exiting...
/Users/robert/.gems/gems/RubyInline-3.12.4/lib/inline.rb:564:in `abort'
/Users/robert/.gems/gems/RubyInline-3.12.4/lib/inline.rb:564:in `build'
/Users/robert/.gems/gems/RubyInline-3.12.4/lib/inline.rb:856:in `inline'
/Users/robert/.gems/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:17:in `<class:OSXKeychain>'
/Users/robert/.gems/gems/osx_keychain-1.0.2/lib/osx_keychain.rb:6:in `<top (required)>'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/robert/.gem/ruby/2.6.0/gems/cocoapods-keys-2.1.0/lib/keyring.rb:1:in `<top (required)>'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/robert/.gem/ruby/2.6.0/gems/cocoapods-keys-2.1.0/lib/cocoapods_plugin.rb:1:in `<top (required)>'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:94:in `block in safe_activate_and_require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:94:in `each'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:94:in `safe_activate_and_require'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:31:in `block in load_plugins'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:30:in `map'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command/plugin_manager.rb:30:in `load_plugins'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command.rb:326:in `block in run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command.rb:325:in `each'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.2/lib/claide/command.rb:325:in `run'
/Users/robert/.gems/gems/cocoapods-1.7.2/lib/cocoapods/command.rb:52:in `run'
/Users/robert/.gems/gems/cocoapods-1.7.2/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'
---------------------------------------------

[!] Your Podfile requires that the plugin `cocoapods-keys` be installed. Please install it and try installation again.

I have tried:

  • gem install cocoapods-keys --user-install
  • Upgrading and reinstalling Ruby (On version 2.6.3)
  • Sudo gem install cocoapods-keys`

However nothing seems to work.

I would really appreciate it if someone can point me in the right direction!

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 19

Most upvoted comments

@ashfurrow - Sorry, I should have elaborated on how I fixed this. 😃

I did the following in terminal:

  1. brew install rbenv ruby-build
  2. Opened my ~/.zshrc (Or bash if you’re using that)
  3. Paste in if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi at the end of the file.
  4. Save and close the file
  5. Once the brew install (step 1) is done: $ source ~/.zshrc

Then ran the following commands:

  1. rbenv install 2.6.3
  2. rbenv global 2.6.3
  3. ruby -v - to check it updated

Now most importantly do:

which gem If it doesnt report /Users/<youruser>/.rbenv/shims/gem then restart your terminal.

If all goes to plan next run gem install cocoapods-keys

Remember not to use sudo on the gem install.

Now run pod install - and it should go through without errors.

I really appreciate the way @RJ-Clegg explained in a detailed way to fix the issue of cocoapods-keys.

But for those who have failed to get the value of path as mentioned here, even after restarting terminal:-

which gem If it doesnt report /Users/<youruser>/.rbenv/shims/gem then restart your terminal.

Solution

Do the following -

Pre-Steps A. gem list --local | grep cocoapods | awk '{print $1}' | xargs sudo gem uninstall -> remove all existing cocoapod installation B. sudo gem uninstall -aIx -> remove the existing gem installation from local mac

Now, follow as mentioned in the above by @RJ-Clegg , with some custom steps:-

  1. brew install rbenv ruby-build
  2. In terminal do the following steps
  • touch ~/.zshrc --> To make sure file is created
  • open ~/.zshrc --> Open the file
  • add the following line if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi at the end of file.
  • Save and close the file.
  • source ~/.zshrc -> to add it in the shell
  1. After completing Step 2 , run the following
  • rbenv install 2.6.3
  • rbenv global 2.6.3
  • ruby -v --> to check it’s updated
  • which gem It will surely show /Users/<youruser>/.rbenv/shims/gem
  1. Install cocoapods from scratch
  • sudo gem install -n /usr/local/bin cocoapods
  • pod setup
  1. Final step install cocoapod-key
  • gem install cocoapods-keys

That’s it, now cocoapods-key will not show error in case of pod install or update 🥳

@ashfurrow - Sorry, I should have elaborated on how I fixed this. 😃

I did the following in terminal:

  1. brew install rbenv ruby-build
  2. Opened my ~/.zshrc (Or bash if you’re using that)
  3. Paste in if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi at the end of the file.
  4. Save and close the file
  5. Once the brew install (step 1) is done: $ source ~/.zshrc

Then ran the following commands:

  1. rbenv install 2.6.3
  2. rbenv global 2.6.3
  3. ruby -v - to check it updated

Now most importantly do:

which gem If it doesnt report /Users/<youruser>/.rbenv/shims/gem then restart your terminal.

If all goes to plan next run gem install cocoapods-keys

Remember not to use sudo on the gem install.

Now run pod install - and it should go through without errors.

thank u man, i’ve spend 30 minutes for this problem and u helped me

Very helpful!!! Thanks a lot, saved lots of time!👌👍

NOTE FOR MacOS Big Sur Users: In order for the above to work, you need to have the LATEST version of XCode. (In my Case 12.2)

gem install cocoapods-keys

in case you dont have have permission try this export GEM_HOME=“$HOME/.gem”