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

Ruby on-RailsRubyGemBundlerrailstutorial.org

Ruby on-Rails Problem Overview


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.

Ruby on-Rails Solutions


Solution 1 - Ruby on-Rails

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 - Ruby on-Rails

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 - Ruby on-Rails

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 - Ruby on-Rails

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

service network restart

If its *nix machine.

Solution 5 - Ruby on-Rails

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.

Solution 6 - Ruby on-Rails

The other reason causing such that issues is the fact if you are behind proxy server. I describe here solution, maybe it will be usefull for someone else. :)

In case that you did not know Login/pass for yours proxy, and meet this issues you could firstly check if you need to (re)install anything, by command:

C:\...> bundle check
Resolving dependencies...
The Gemfile's dependencies are satisfied

If you get other respons then above, you could find properly gems in properly versions here (rubygems.org), then install it (from the directory with downloaded gem) by command:

gem install <gem-name> --locally 

Solution 7 - Ruby on-Rails

I had this issue while working in Cloud 9. After trying several 'bundle install' and sending an email to c9 support(no reply) I was able to get it working by killing all the processes and doing a hard-restart of the IDE.

Do this by clicking directly on the little bar-graphs at the top of the right-hand side that show CPU, Memory, Disk. Then click on the process list, select them all, and force kill. Then exit out of the process list. Click on the bar-graphs again, and this time click 'Restart'.

After this I was able to run bundle with no problems.

Solution 8 - Ruby on-Rails

Either with http or https did not work.

After I disabled the IP v6, it worked

https://support.purevpn.com/how-to-disable-ipv6-linuxubuntu

Solution 9 - Ruby on-Rails

Mine was just a simple network issue, just restart pc / router

Solution 10 - Ruby on-Rails

Use wget to see if you can reach the domain

wget http://rubygems.org/latest_specs.4.8.gz

If this fails then try the following.

Edit your /etc/resolv.conf file and add these lines near the top to use Google's name servers

nameserver 8.8.8.8
nameserver 8.8.4.4

Solution 11 - Ruby on-Rails

Adding variable for proxy worked fine.

Additionally if you are using Bitnami redmine like me you can add that into setenv.bat then when you start command line with Bitnami Redmine short cut it will be automatically added to your environment. You can find this under Bitnami installation folder.

Solution 12 - Ruby on-Rails

If you are using Cloud9, just restart (command R) and try again

Solution 13 - Ruby on-Rails

Sometimes it happens due to proxy you are using. I tried to resolve this by using a connection without proxy and all worked perfectly fine.
Then try:

bundle update

And then go for

bundle install

Solution 14 - Ruby on-Rails

For me, restarting the computer worked. I had already reinstalled ruby, updated bundler, removed 's' https:// but none of them worked!

Solution 15 - Ruby on-Rails

CHange your source form https to http after run

sudo bundle update sudo bundle install

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStevenView Question on Stackoverflow
Solution 1 - Ruby on-RailsWebDragonView Answer on Stackoverflow
Solution 2 - Ruby on-RailsldlView Answer on Stackoverflow
Solution 3 - Ruby on-RailsDmindsView Answer on Stackoverflow
Solution 4 - Ruby on-RailsAziz ZoaibView Answer on Stackoverflow
Solution 5 - Ruby on-RailsmindriotView Answer on Stackoverflow
Solution 6 - Ruby on-RailsArtur_PLView Answer on Stackoverflow
Solution 7 - Ruby on-RailsJeremy GunterView Answer on Stackoverflow
Solution 8 - Ruby on-RailsGeisimar RechView Answer on Stackoverflow
Solution 9 - Ruby on-RailsA. AskarovView Answer on Stackoverflow
Solution 10 - Ruby on-RailsJustin LeveckView Answer on Stackoverflow
Solution 11 - Ruby on-RailsHeungwooView Answer on Stackoverflow
Solution 12 - Ruby on-RailsAndrewjsView Answer on Stackoverflow
Solution 13 - Ruby on-RailsAkash KumarView Answer on Stackoverflow
Solution 14 - Ruby on-RailsChristian DziwornuView Answer on Stackoverflow
Solution 15 - Ruby on-RailsNicollasView Answer on Stackoverflow