ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository

纵饮孤独 提交于 2019-12-07 08:24:06

问题


i am trying to run a AWS Cognito service project in which i have added the AWS SDK for iOS but after adding it and trying to run it it shows me the below shown error in the image

ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository

when i crawl it on internet and found some cocoapods install instructions so after trying that i got some other error like below

aparajita:Objective-C Aparajita$ sudo gem install cocoapods
Password:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
ERROR:  Could not find a valid gem 'cocoapods' (>= 0) in any repository
aparajita:Objective-C Aparajita$ gem install cocoapods
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
ERROR:  Could not find a valid gem 'cocoapods' (>= 0) in any repository
aparajita:Objective-C Aparajita$ gem source -a http://rubygems.org/
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
https://rubygems.org is recommended for security over http://rubygems.org/

Do you want to add this insecure source? [yn]  y
Error fetching http://rubygems.org/:
no such name (http://rubygems.org/specs.4.8.gz)
aparajita:Objective-C Aparajita$ gem source -a rubygems.org
 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
rubygems.org is not a URI
aparajita:Objective-C Aparajita$ gem source -r rubygems.org
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin14/rbconfig.rb:213: warning: Insecure world writable dir /usr/local in PATH, mode 040777
source rubygems.org not present in cache

i have tried it all but still above log i got from the console . if any one have any solution on this please let me know, thanks


回答1:


I am facing the same problem and I resolved it by issuing using the following command

sudo gem install cocoapods --source http://rubygems.org




回答2:


OK, I just had this problem. If anyone seems to have this problem DO NOT change directories.

Load up terminal and straight away add the line -

sudo gem install cocoapods

Worked for me.




回答3:


I struggled with same issue 1 week, finally this works for me

Disable IPv6 and try again with sudo gem install cocoapods --source http://rubygems.org

Issues seems with network

Few more details give on rugby gems forum - https://help.rubygems.org/discussions/problems/31074-timeout-error



来源:https://stackoverflow.com/questions/34784844/error-could-not-find-a-valid-gem-cocoapods-0-in-any-repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!