Skip to content
GitHub

Configure Ruby

Route RubyGems requests through Depsilo's /rubygems/ path with a Bundler mirror.

BEFOREhttps://rubygems.org
AFTERhttp://localhost:23333/rubygems/

Bundler replaces rubygems.org with Depsilo through a mirror setting; Gemfile and Gemfile.lock stay unchanged.

Run this from the project directory containing Gemfile, with an explicit local scope:

终端窗口
bundle config set --local mirror.https://rubygems.org http://localhost:23333/rubygems/
bundle config get mirror.https://rubygems.org

--local writes to the project’s .bundle/config, or config inside BUNDLE_APP_CONFIG when that variable is set. Record the previous mirror and preserve other settings. Use --global only when you intend to affect all projects for that user. See the Bundler configuration reference.

  1. Check that the instance is ready

    终端窗口
    curl -fsS http://localhost:23333/ready
  2. Install dependencies using the existing lockfile

    终端窗口
    bundle install
  3. Confirm the traffic in Admin

    Match /rubygems/ requests to this run in Access logs, distinguishing index and metadata requests from .gem files. Installed dependencies or Bundler’s local cache may avoid a new download. Repeating bundle install alone does not establish a server cache hit.

  4. Verify artifact caching separately

    See Verify caching for independent artifact downloads and log checks. Its example uses an npm tarball; Ruby cache verification needs matching .gem requests and hit results. The first request may already be a hit if the server cache is warm.

Restore the project’s previous mirror. If it had no mirror setting, run bundle config unset --local mirror.https://rubygems.org and keep the other settings. If you changed user configuration instead, restore the value in that same scope.