Skip to content
Alena edited this page Mar 31, 2023 · 4 revisions

Gem

Gem repository supports hosting of Ruby packages. Here is configuration example:

repo:
  type: gem
  storage:
    type: fs
    path: /var/artipie/data/

Check storage documentations to learn more about storage setting.

Before uploading gems, obtain a key for authorization and set it to GEM_HOST_API_KEY environment variable. A base64 encoded {username}:{password} pair would be a valid key:

export GEM_HOST_API_KEY=$(echo -n "{username}:{password}" | base64)

In order to upload a .gem file into Artipie Gem repository, use gem push command and --host option to specify repository URL:

$ gem push my_gem-0.0.0.gem --host http://{host}:{port}/{repository-name}

In order to install an existing gem package, use gem install command and --source option to specify repository ULR:

$ gem install my_gem --source http://{host}:{port}/{repository-name}

In the example above {host} and {port} are Artipie service host and port, {repository-name} is the name of the repository (and repository name is the name of the repo config yaml file), {username} and {password} are Artipie user credentials.