cacheport

Error · RubyGems

Fixing Bundler "Could not fetch specs from https://rubygems.org/"

Bundler could not download the index it needs to resolve gems. The underlying error, shown after "due to", tells you whether it was a timeout, a TLS problem or an HTTP error.

What you see

build log
Could not fetch specs from https://rubygems.org/ due to underlying error <Bundler::HTTPError: Net::OpenTimeout>

Common causes

  • Timeouts reaching rubygems.org from the runner.
  • Old OpenSSL or CA certificates in custom images.
  • Proxies or firewalls blocking index.rubygems.org.

How to fix it

  1. 01

    Read the underlying error

    Run Bundler with verbose output to see which request failed.

    shell
    bundle install --verbose
  2. 02

    Retry

    Bundler can retry network requests.

    shell
    bundle config set --global retry 5
  3. 03

    Use a mirror in your region

    A mirror setting keeps Gemfile.lock unchanged.

    shell
    bundle config set --global mirror.https://rubygems.org https://acme.cacheport.cc/gems/

Other network failures in builds

Start on the free plan

20 GB of cache, every registry, unlimited users. Upgrade when your pipelines outgrow it.