# RubyGems mirror (pkg.shecan.ir)

> Mirror of rubygems.org for Bundler and the gem command: the compact index (/versions, /info/, /names), .gem files and the legacy specs indexes.

- Upstream: rubygems.org
- Mirror URL: <https://mirror-rubygems.pkg.shecan.ir/>
- Clients: bundler, gem
- Service status: <https://pkg.shecan.ir/status.json> (key `rubygems`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/rubygems/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/rubygems.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `rubygems`, mirror `shecan`): <https://audit.shecan.ir/#rubygems>

## Limitations

- Read-only: gem push, yank, owner, signin and the other API commands are not supported.
- Bundler keeps https://rubygems.org/ as the source in Gemfile and Gemfile.lock; the mirror setting redirects it, so neither file changes.
- Gems from git sources (git: or github: in the Gemfile) are fetched from their own hosts.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### bundler: persistent (user- or system-wide configuration)

Run

```sh
bundle config set --global mirror.https://rubygems.org https://mirror-rubygems.pkg.shecan.ir
```

Undo / restore the default

```sh
bundle config unset --global mirror.https://rubygems.org
```

### bundler: project (files inside the project)

Run

```sh
bundle config set --local mirror.https://rubygems.org https://mirror-rubygems.pkg.shecan.ir
```

### gem: persistent (user- or system-wide configuration)

Run

```sh
gem sources --add https://mirror-rubygems.pkg.shecan.ir/ --remove https://rubygems.org/
```

Undo / restore the default (checked by hand)

```sh
gem sources --add https://rubygems.org/ --remove https://mirror-rubygems.pkg.shecan.ir/
```
