Search code examples
objective-cterminalcocoapods

Unable to install cocoapods in my Mac 10.13.1


i am using following command:

sudo gem install cocoapods

for this i am getting following response:

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)

i tried uninstalling cocoapods and restart ....everything.

upadte 1:

i try to debug

gem install bundler --debug -V

i got following output:

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

Update 2:

i changed proxys in my mac .. now i am getting :

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

Solution

  • finally i found the answer:

    just connected to ur personal Hotspot and use following command:

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