2

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.

0

5 Answers 5

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

I need 0.36.1 unfortunately.
0

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

2 Comments

Does not help. gem install xcodeproj installs xcodeproj-0.22.0. But latest cocoa pods 0.36.1 requires version 0.23.1.
Fetching and installing xcodeproj will not help at all.
0

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

1 Comment

Issuing gem update will only update gems that are already installed.
0

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 

1 Comment

Fetching and installing xcodeproj will not help at all.
0

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

1 Comment

did not work. "source cache successfully updated" and still getting the same error as posted in question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.