Issue Summary
I’m experiencing persistent connection failures to rubygems.org when deploying a Rails app using Depot builder. The build fails during bundle install with connection reset errors.
Environment
- App region: nrt (Tokyo)
- Builder region: IAD (recently changed to NRT, but issue persists)
- My location: Australia (likely using Sydney Depot builder)
- Rails version: 8.1.0
- Ruby version: 3.4.4
- Bundler version: 2.6.7
Error Message
Fetching source index from https://rubygems.org/
Retrying fetcher due to error (2/11): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://rubygems.org/specs.4.8.gz)>
...
Retrying fetcher due to error (11/11): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <IOError: HTTP session not yet started (https://rubygems.org/specs.4.8.gz)>
Could not fetch specs from https://rubygems.org/ due to underlying error
<IOError: HTTP session not yet started (https://rubygems.org/specs.4.8.gz)>
What I’ve Tried
- Added retry and timeout configs to Dockerfile:
dockerfile
RUN bundle config set --local retry 10 && \
bundle config set --local timeout 60 && \
bundle install
→ Still fails
-
Changed App Builders region from IAD to NRT in Fly.io dashboard → No improvement
-
Recreated the app machine (scale down to 0, then back to 1) → No change
-
Multiple deployment attempts over several hours → Consistently fails
Workaround
Using --depot=false works perfectly:
bash
flyctl deploy --app app_name --image-label latest --depot=false
This suggests the issue is specific to Depot builder’s network connectivity to rubygems.org.
Question
Is there a known issue with Depot builder connectivity to rubygems.org from certain regions (possibly Sydney)?
Since I’m deploying from Australia, I suspect the Depot builder is running in the Sydney region and experiencing network issues reaching rubygems.org. Other users deploying from different regions might not encounter this problem.
Is there a way to:
-
Force Depot builder to use a specific region?
-
Debug which Depot builder region is actually being used?
-
Or should I just stick with
--depot=falseas a permanent solution?
Any insights would be appreciated!