Search code examples
ruby

Unable to download from rubygems.org


I just installed ruby version 2.3.0p0 using the ruby installer for windows and was trying to install bundler. When I run gem install bundler I get the following error:

Could not find a valid gem 'bundler' (>=0), here is why
Unable to download data from (link removed) rubygems -Errno:ETIMEDOUT:
Failed to open TCP connection to api.rubygems.org:443 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. -connect(2) for "api.rubygems.org" port 443)(https://api.rubygems.org/specs.4.8.gz)

Some research led me to try running gem install --http-proxy http://[user]:[password]@[server]:[port] which i think might work because I am behind a proxy here and a similiar solution helped me clone a git repository earlier.
But when i tried this command I got the following error:

ERROR: While executing gem ... (Gem:CommandLineError)
Please Specify at least one gem name (e.g. gem build GEMNAME)

UPDATE
So I tried that gem install --http-proxy.... command again with the gem name at the end and I am back to getting the original TCP connection error above. I am pretty sure the login information I entered is correct. I also added --source http://... instead of the https one but still am having the same problem?


Solution

  • 1st off your error is pretty telling-

    ERROR: While executing gem ... (Gem:CommandLineError) Please Specify at least one gem name (e.g. gem build GEMNAME)

    2nd make sure you have met the requirements for what you're trying to do http://bundler.io/ then run the code..

    gem install bundler
    bundle init
    echo 'gem "rspec"' >> Gemfile
    bundle install
    bundle exec rspec