In order to allow the integration with the gem command line tool, you must add the relevant source URL to your RubyGems configuration.
In the Application module | Artifactory | Artifacts Tree Browser, select your newly created repository and click Set Me Up.
Copy the source URL from the RubyGems Sources section.
Add this URL by modifying your
~/.gemrcfile or using the
gem sourcecommand 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/gemsin 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.
Use a source URL with embedded credentials, such as: gem sources