Evgenii
Evgenii

Reputation: 37349

Error installing CocoaPods

I am trying to install the latest CocoaPods (which is 0.36.1) but it shows me the following error.

$ gem install cocoapods
ERROR:  Could not find a valid gem 'xcodeproj' (~> 0.23.1) in any repository

Sudo?

Btw, in the answered questions some are proposed using sudo get install cocoapods. You do need sudo indeed if you are using the system-wide ruby executable. I am using rbenv for my ruby management, it is installed locally for the user and does not need sudo.

Update

The gem install cocoapods command worked the following day. Mystery.

Upvotes: 2

Views: 2988

Answers (5)

Alan Cabrera
Alan Cabrera

Reputation: 732

Next time that occurs, run the command gem sources -u to update your source cache and try again.

Upvotes: 0

Chris Trevarthen
Chris Trevarthen

Reputation: 179

If the automatic downloading of xcodeproj 0.23 fails, you can fetch the gem file manually:

gem fetch xcodeproj -v 0.23.0

This will put the .gem file in your current directory.

Then you can install the gem:

gem install xcodeproj -v 0.23.0

If the xcodeproj gem installs successfully, you can continue with your install of cocoapods as usual:

gem install cocoapods

Upvotes: 0

Steffen Vangsgaard
Steffen Vangsgaard

Reputation: 530

I think you need to update your gems repo.

try issuing "gem update" in a terminal. Can't remenber if you need sudo.

Try that, and then try installing xcodeproj and cocoapods again.

Regards Steffen

Upvotes: 0

Deepak Sharma
Deepak Sharma

Reputation: 373

I think you could try an older version of the pods.

I tried: sudo gem install cocoapods -v 0.34.0 and this worked for me.

Upvotes: 4

Mayank Patel
Mayank Patel

Reputation: 3908

For your error you should do like this

i) $ sudo gem install xcodeproj

ii) $ sudo gem install cocoapods

for pod version you can verify pod --version

Upvotes: 0

Related Questions