7

I recently updated to ruby v 2.6 After upgrading I'm facing issue installing pods with the following error

Traceback (most recent call last):
    7: from /usr/local/bin/pod:23:in `<main>'
    6: from /usr/local/bin/pod:23:in `load'
    5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
    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 -- xcodeproj (LoadError)
    8: from /usr/local/bin/pod:23:in `<main>'
    7: from /usr/local/bin/pod:23:in `load'
    6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:36:in `<top (required)>'
    5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods.rb:2:in `<top (required)>'
    2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
    1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require': cannot load such file -- xcodeproj (LoadError)

I have tried sudo gem install cocoapods but with no help.

Anyone facing similar issue and found a solution?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
vedant shirke
  • 359
  • 4
  • 9
  • 3
    Install RVM with `\curl -sSL https://get.rvm.io | bash -s stable`; restart your shell; install Ruby with `rvm install 2.6`. [Don't](https://robots.thoughtbot.com/psa-do-not-use-system-ruby) [use](https://chrisherring.co/posts/why-you-shouldn-t-use-the-system-ruby) [system Ruby](http://billpatrianakos.me/blog/2014/05/15/never-use-system-ruby-ever/). – anothermh Jan 17 '20 at 06:58
  • Thanks. Worked like a charm. Though had to install cocoapods again. – vedant shirke Jan 17 '20 at 07:15

4 Answers4

16

Seems like you need install gem xcodeproj, run in terminal :

gem install xcodeproj

see here

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Gray Locus
  • 161
  • 1
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30854427). Also see https://meta.stackoverflow.com/tags/link-only-answers/info – the Tin Man Jan 25 '22 at 22:25
  • This worked work me and does provide an answer to the 2nd half of the original question "Anyone facing similar issue and found a solution?" – noodl_es Oct 11 '22 at 01:16
  • 1
    This one produced permission error in my case. So first I got help from this : https://stackoverflow.com/a/54873916/10268364 Then I run this command successfully. – cansu Jan 02 '23 at 02:58
0

Install RVM with \curl -sSL https://get.rvm.io | bash -s stable; restart your shell; install Ruby with rvm install 2.6.

gem install cocoa pods
pod install

this worked for me

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Rolika
  • 11
0

This happened to me when after doing a tns migrate on NativeScript 6.5, and I had been building fine before the command was run.

I fixed this by running tns doctor which said my cocoapods install was missing. So the tns doctor went into reinstall mode automatically to try and fix the problem, and I let it reinstall cocoapods and xcodeproj.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
gadildafissh
  • 2,243
  • 1
  • 21
  • 26
0

sudo gem install cocoapods && pod install

Tatyana Molchanova
  • 1,305
  • 5
  • 12
  • 23