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:40

In your Gemfile from the first line the source should be http:// instead of https://

change

sourçe  https://www.rubygems.org into

source  http://www.rubygems.org

Then you can run bundle install successfully

查看更多
ら.Afraid
3楼-- · 2020-08-21 04:42

I had the same issue and it happened to work when I shutdown the rails server before running bundle install

查看更多
家丑人穷心不美
4楼-- · 2020-08-21 04:43

I was getting the same error when running bundle in a rails app. I solve the problem by running:

$ bin/bundle

Problem was that bundle was v1.17.3, while bin/bundle was version 2.0.2.

查看更多
孤傲高冷的网名
5楼-- · 2020-08-21 04:49

Sometimes, Your DNS cause this problem.

You can change your DNS to 1.1.1.1 or 8.8.8.8

Instructions for mac

  • Go to preferences panel
  • Click on network panel
  • Click to advanced button
  • Go to DNS tab
  • Add DNS server (with '+' button)
  • Enter 1.1.1.1 OR 8.8.8.8
  • Click to Ok
  • And click to apply

But you can follow these steps: http://www.macinstruct.com/node/434

Instructions for windows

https://www.windowscentral.com/how-change-your-pcs-dns-settings-windows-10

查看更多
登录 后发表回答