Use this API to interact with the Ruby gems and Bundler package manager clients.

This API is used by the Ruby gems and Bundler package manager clients and is generally not meant for manual consumption. This API is under development and is not ready for production use due to limited functionality.

These endpoints do not adhere to the standard API authentication methods. See the Ruby gems registry documentation for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.

Retrieve dependencies

GET /api/v4/projects/{id}/packages/rubygems/api/v1/dependencies

Retrieves a list of dependencies for specified gems. The response is a marshalled array of hashes for all versions of the requested gems. Because the response is marshalled, you can store it in a file. Each hash contains name, number, platform, and dependencies, where dependencies is an array of [name, requirement] pairs. To read the response with Ruby, authenticate the request with an access token or with credentials set in ~/.gem/credentials.

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project
gems
Query
Array of stringsComma-separated list of gems to fetch dependencies for

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Upload a gem

POST /api/v4/projects/{id}/packages/rubygems/api/v1/gems

Uploads a gem for a specified project.

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project

Request body (multipart/form-data)

PropertyTypeDescription
file
Required
String (binary)The package file to be published (generated by Multipart middleware)

Responses

CodeDescriptionSchema
201Created—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Authorize a gem upload from workhorse

POST /api/v4/projects/{id}/packages/rubygems/api/v1/gems/authorize

This feature was introduced in GitLab 13.9

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project

Responses

CodeDescriptionSchema
200OK—
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Download a gem file

GET /api/v4/projects/{id}/packages/rubygems/gems/{file_name}

Downloads a specified gem file for a project.

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project
file_name
Path, required
StringName of the .gem file

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Download a gemspec file

GET /api/v4/projects/{id}/packages/rubygems/quick/Marshal.4.8/{file_name}

Downloads a gemspec file in Marshal format for a specified gem version. The response is a deflate-compressed, marshalled Gem::Specification object.

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project
file_name
Path, required
StringName of the gemspec file, in the format <gem_name>-<version>.gemspec.rz

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—

Download the spec index file

GET /api/v4/projects/{id}/packages/rubygems/{file_name}

Downloads a RubyGems spec index file (specs.4.8.gz, latest_specs.4.8.gz, or prerelease_specs.4.8.gz) for a project. The index lists the gems available in the project registry. specs.4.8.gz lists released versions, latest_specs.4.8.gz lists the latest released version of each gem, and prerelease_specs.4.8.gz lists prerelease versions. The response is a Gzip-compressed, marshalled array of [name, version, platform] entries.

Parameters

NameTypeDescription
id
Path, required
Integer or stringID or URL-encoded path of the project
file_name
Path, required
StringName of the spec file
Allowed values: specs.4.8.gz, latest_specs.4.8.gz, prerelease_specs.4.8.gz
Minimum length: 1

Responses

CodeDescriptionSchema
200OKString (binary) (application/octet-stream)
400Bad Request—
401Unauthorized—
403Forbidden—
404Not Found—