我正在使用以下命令:
sudo gem install cocoapods
为此我得到以下回应:
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to api.rubygems.org:443 (Connection refused - connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.8.gz)
我尝试卸载cocoapods并重新启动....一切。
放大1:
我试着调试
gem install bundler --debug -V
我得到以下输出:
Exception `LoadError' at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/resolv.rb:171 - LoadError
Exception `Gem::UnsatisfiableDependencyError' at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/resolver/installer_set.rb:71 - Unable to resolve dependency: user requested 'bundler (>= 0)'
ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository
更新2:
我在我的mac中更改了代理..现在我得到了:
Could not find a valid gem 'cocoapods' (>= 0) in any repository
最后我找到了答案:
刚连接到您的个人热点并使用以下命令:
$ sudo gem install cocoapods --source http://rubygems.org