Bundle install is not working

2020-08-21 03:43发布

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?

10条回答
甜甜的少女心
2楼-- · 2020-08-21 04:24

I faced the same issue but on Ubuntu, what helped was running:

env | grep proxy

which showed some active proxies like these:

https_proxy=127.0.0.1:8888
http_proxy=127.0.0.1:8888

After I removed each of them with the unset command:

unset https_proxy
unset http_proxy

I could run bundle install normally.

查看更多
叼着烟拽天下
3楼-- · 2020-08-21 04:24

It's a connectivity issue.I solved it through hideMe VPN. it is used to bypass blocked websites or for servers down only for a particular user

查看更多
虎瘦雄心在
4楼-- · 2020-08-21 04:25

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.

查看更多
贼婆χ
5楼-- · 2020-08-21 04:26

It's a connectivity issue.

I solved it through hideMe VPN. It is used to bypass blocked websites or for servers down only for a particular user.

Now everything seems to work just fine.

查看更多
混吃等死
6楼-- · 2020-08-21 04:32

This mistake was very difficult for me. I was a day without being able to solve it but finally I turned off my wifi router and waited 1 minute to turn it on again. Then the error was fixed, hope it helps.

查看更多
仙女界的扛把子
7楼-- · 2020-08-21 04:38

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'.

查看更多
登录 后发表回答