pod install fails with "cannot load such file -- xcodeproj"
Asked Answered
L

5

14

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?

Liquid answered 17/1, 2020 at 6:53 Comment(2)
Install RVM with \curl -sSL https://get.rvm.io | bash -s stable; restart your shell; install Ruby with rvm install 2.6. Don't use system Ruby.Ferdelance
Thanks. Worked like a charm. Though had to install cocoapods again.Liquid
S
33

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

gem install xcodeproj

see here

Slub answered 19/1, 2022 at 9:22 Comment(3)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review. Also see meta.stackoverflow.com/tags/link-only-answers/infoIn
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?"Melodize
This one produced permission error in my case. So first I got help from this : https://mcmap.net/q/65113/-you-don-39-t-have-write-permissions-for-the-library-ruby-gems-2-3-0-directory-mac-user Then I run this command successfully.Gigot
E
3

Only this worked for me:

sudo gem install cocoapods --user-install
Earn answered 6/11, 2023 at 18:3 Comment(0)
M
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

Marr answered 18/5, 2021 at 10:32 Comment(0)
T
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.

Torchwood answered 12/8, 2021 at 19:42 Comment(0)
D
0

sudo gem install cocoapods && pod install

Diseuse answered 13/5, 2023 at 9:10 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.