Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bundle install is not working

I'm developing Ruby on Rails on Windows.

Something went wrong with our local network and can't access https://www.rubygems.org, seems like it is blocked or something.

But I can access it through http://www.proxyfoxy.com.

Below is the result of bundle install:

$ bundle install

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

Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/

Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/

Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/

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

Is there any other way to install gems through bundle install?

like image 709
ruby1141 Avatar asked Jul 16 '16 10:07

ruby1141


2 Answers

Open the Gemfile and change first line from this

source 'https://www.rubygems.org'

to this

source 'http://www.rubygems.org'

remove the 's' from 'https'.

like image 62
ACHYUT KADAM Avatar answered Oct 05 '22 08:10

ACHYUT KADAM


As @Wasif mentioned, first make sure the Ruby Gems site is up and your network access is ok.

If they works fine, try it like this:

  • First, delete your Gemfile.lock file

  • Then run gem update --system

  • Then in your Gemfile try changing the first line source 'https://rubygems.org'to http:// (without an s)

Unless there is a problem with your connectivity this should fix the issue with bundle install.

like image 22
Lahiru Jayaratne Avatar answered Oct 05 '22 08:10

Lahiru Jayaratne