我正在尝试运行AWS Cognito服务项目,其中我已经添加了适用于iOS的AWS SDK,但在添加它并尝试运行它后,它会向我显示图像中显示的以下错误
ERROR: Could not find a valid gem 'cocoapods' (>= 0) in any repository
当我在互联网上抓取它并发现一些cocoapods安装说明所以在尝试之后我得到了一些其他错误,如下面
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
我已经尝试了所有但仍然在我从控制台获得的日志之上。如果有人对此有任何解决方案,请告诉我,谢谢
答案 0 :(得分:6)
好的,我刚遇到这个问题。如果有人似乎有这个问题,请不要更改目录。
加载终端并立即添加线 -
sudo gem install cocoapods
为我工作。
答案 1 :(得分:2)
答案 2 :(得分:0)
我在同一个问题上挣扎了1周,终于对我有用
禁用IPv6,然后使用 sudo gem install cocoapods --source http://rubygems.org
重试网络似乎有问题
关于橄榄球宝石论坛的更多细节很少-https://help.rubygems.org/discussions/problems/31074-timeout-error
答案 3 :(得分:0)
确保Mac中已安装Xcode。首次打开后,您需要接受条款和条件,并且可能需要安装一些组件。安装并正常工作后,然后安装Pod:
sudo gem install cocoapods
答案 4 :(得分:0)
在我的情况下,我使用了VPN,因为http://rubygems.org不可用,所以当我在sudo gem install cocoapods上切换VPN时就可以使用
答案 5 :(得分:0)
这个命令对我有用
sudo gem install cocoapods --source http://rubygems.org