Use Remote RubyGems Repositories

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

In order to allow the integration with the gem command line tool, you must add the relevant source URL to your RubyGems configuration.

  1. In the Application module | Artifactory | Artifacts Tree Browser, select your newly created repository and click Set Me Up.

  2. Copy the source URL from the RubyGems Sources section.

    RubyGemsSourceURL.jpg
  3. Add this URL by modifying your ~/.gemrc file or using the gem source command as follows:

    All RubyGems repositories must be prefixed with api/gems in the path

    When using the RubyGems command line to access a repository through Artifactory, the repository URL must be prefixed with api/gems in the path.

    gem source -a http://localhost:8081/artifactory/api/gems/rubygems/
    

Additional Gem Commands You Can Use

You can remove previous source entries by modifying your ~/.gemrc file manually or by running gem sources -r

You can also run gem sources --list to know what your effective sources are and their order.

Overcoming Unauthorized Status Failures

Some gem/bundler commands may fail with an Unauthorized (401) status. In some cases these can be overcome by usingoneof the following options:

  • Enable the "Anonymous User" by checking Allow Anonymous Access in Security General Configuration as described in Managing Users.

  • Create a specialized Permission Target that allows anonymous access only to the remote repository.Permissions

  • Use a source URL with embedded credentials, such as: gem sources -a http://user:password@host /...