Bundle Install could not fetch specs from https://rubygems.org/

77,325

Solution 1

Just in case none of the above satisfies the next intrepid explorer, I thought I'd drop here that after I spent 4 hours on this doing variants of the search that landed me here, I finally discovering that IPV6 was the culprit, after finding this specific thread on help.rubygems.org. Solution? this (Fedora, Linux):

sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1

set up a shell script to flip IPV6 on and off so I could run a command without it, and now everything runs peachy.

Solution 2

I had the same issue. The only working solution I found was to force http instead of https in Gemfile:

source 'http://rubygems.org'

Solution 3

you can try the following, if in windows:

set HTTP_PROXY= <your proxy address without http://>

set HTTPS_PROXY=%HTTP_PROXY%

For eg:

HTTP_PROXY=mycompany.myproxy.com:8080

HTTPS_PROXY=%HTTP_PROXY%

Worked for me

Solution 4

It can be temporary network issue as well. Try restarting network services using command

service network restart

If its *nix machine.

Solution 5

I had the same issue using ruby-2.0.0-p247 on OS X 10.8.5.

Make sure the first line in Gemfile is using https://

source 'https://rubygems.org'

I reinstalled that version of ruby.

rvm reinstall ruby-2.0.0

Ruby was upgraded ruby-2.0.0-p598 (version depends on latest patch).

bundle then worked without error although all the gems were reinstalled.

Share:
77,325
Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm attempting to follow the Hartl Rails Tutorial, and having trouble with the bundler gem.

    When using the commands 'bundle install' or 'bundle update' I get the following output:

    Fetching source index from https://rubygems.org/

    Could not fetch specs from https://rubygems.org/

    I've searched for this output, but did not find many related issues online.

    Maybe I have another gem that is interrupting bundler? I have little experience with rails at this point.

        source 'https://rubygems.org'
    
    gem 'rails', '3.2.12'
    
    group :development do
      gem 'sqlite3', '1.3.5'
    end
    
    
    # Gems used only for assets and not required
    # in production environments by default.
    group :assets do
      gem 'sass-rails',   '3.2.5'
      gem 'coffee-rails', '3.2.2'
    
      gem 'uglifier', '1.2.3'
    end
    
    gem 'jquery-rails', '2.0.2'
    

    The solution for me was two parts: I changed https to http, and that temporarily solved the issue. The second issue was that I think I had a bad install of ruby 2.0.0 even though I was using a fresh install of ruby 1.9.3. So I reinstalled ruby 2.0.0, and I could use bundle install with https.