theMessanger theMessanger - 21 days ago 7
Ruby Question

network error while fetching

I am new to Ruby on Rails and I would like to know how I can solve this: I am using windows, when I run a new project, for example:

Rails new project_name


I get this error:

Fetching source index from https://rubygems.org/
Resolving dependencies...........
Network error fetching
https://rubygems.org/quick/marshal.4.8/json-1.8.3-java.gemspec.rz

Answer

There are a few possible solutions to this issue.

  1. Your network isn't working right now or has a bad connection. Make sure wifi is working, connect to an ethernet cable, or just wait.
  2. Rubygems is having some sort of issue. Check at https://status.rubygems.org/
  3. Bundler and/or Rubygems have a bug.

Upgrade gem and bundler to the latest version:

gem update --system
gem update bundler

If gem update --system fails, you may have an old enough version of RubyGems that you need a special upgrader:

gem install rubygems-update
update_rubygems
gem update --system
gem update bundler

Depending on how if it was originally installed with sudo, you may need to run these commands with sudo as well.

If you are still having issues, I've run out of answers and you'll need to sacrifice a small puppy on the alter of BundlerWhatHaveIDoneToDeserveThis.