Ruby Proxy
Repsy’s Ruby Proxy feature allows your Ruby repositories to act as intelligent proxies to external gem sources such as rubygems.org or private repositories.
A Ruby proxy repository acts as an intermediary between Bundler and external gem sources. When Bundler requests a gem that does not exist locally, the proxy automatically fetches it from the configured upstream sources and caches it for future use.
Important: Only Bundler (
bundle install) is supported in proxy mode. Thegem installcommand relies on the legacyspecs.4.8.gzindex, which is not served by the Repsy proxy. Usebundle installwith aGemfilefor all proxy-backed installations.
Setting Up Ruby Proxy
Configuring Proxy Sources
You can configure multiple upstream sources with different priorities:
Public RubyGems Source
Proxy URL: https://rubygems.org
Private Ruby Repository
Proxy URL: https://gems.yourcompany.com
Username: your-username
Password: your-password
Common Configuration Options
For all proxy types, you can configure:
- SSL Validation: Enable/disable SSL certificate validation
- Connection Timeout: Set timeout in milliseconds (default: 5000ms)
- Active Status: Enable or disable the proxy
How Ruby Proxy Works
Package Resolution Flow
- Client Request: Bundler requests a gem from your
Repsyrepository via the Compact Index protocol. - Local Check:
Repsychecks if the gem exists in local storage. - Proxy Fallback: If not found locally,
Repsyqueries configured proxies in priority order. - Authentication: Credentials are used if the proxy requires authentication.
- Caching: Downloads and caches the gem for future requests.
- Response: Returns the gem to the client.
Priority System
Proxies are queried in order of priority. If the first proxy fails or does not contain the requested gem, the next proxy in line is automatically tried. You can easily change the order of the proxies to customize the resolution priority.
Best Practices
- Set appropriate priorities based on gem availability and speed.
- Disable unused proxies to reduce latency and avoid timeouts.
- Regularly update credentials for private sources.
- Point your
Gemfilesource to your Repsy repository URL — proxy resolution happens transparently on the server side. Do not usegem install --sourcewith a proxy repository; usebundle installinstead.
Need Help?
Reach out to [email protected] if you need assistance configuring or troubleshooting Ruby proxy functionality.