jf ruby
Configure Ruby/Bundler for dependency resolution and publishing through Artifactory.
When to Use
Use jf ruby-config to configure Bundler/RubyGems to resolve gems from Artifactory. After configuration, standard bundle install commands resolve from your Artifactory repository.
Prerequisites
- Ruby and Bundler must be installed.
- Configure a server with
jf config addorjf c add. - Authentication to Artifactory is required.
Configuration: jf ruby-config
jf ruby-configGenerate Ruby/Bundler configuration for dependency resolution and publishing through Artifactory. Run this once per project before your first bundle install.
To configure Ruby/Bundler for Artifactory:
Synopsis
jf ruby-config [options]
Aliases: rubyc
Configuration Options
| Flag | Default | Description |
|---|---|---|
--global | false | Set to true for global configuration (all projects). Specific projects can override. |
--repo-deploy | — | Repository for artifacts deployment |
--repo-resolve | — | Repository for dependencies resolution |
--server-id-deploy | — | Artifactory server ID for deployment. Configure with jf config add. |
--server-id-resolve | — | Artifactory server ID for resolution. Configure with jf config add. |
Configuration Examples
View Help
jf ruby-config --helpNon-Interactive Configuration with Flags
jf ruby-config --server-id-resolve=<server-id> --repo-resolve=<repo-name>Where:
- <server-id>: The server ID configured using
jf config add - <repo-name>: The name of the Ruby repository in Artifactory
For example:
jf ruby-config --server-id-resolve=my-server --repo-resolve=ruby-virtualGlobal Configuration
jf ruby-config --global --server-id-resolve=<server-id> --repo-resolve=<repo-name>Why Run Config First?
You must run jf ruby-config before using bundle install with Artifactory. The config sets the gem source to point to your Artifactory repository. Without it, Bundler resolves from the default public gem sources.
Shortcut: In CI/CD, pass all flags non-interactively so the config step is fully automated and reproducible.
Configuration Notes
- Config-only: There is no
jf rubycommand. After runningjf ruby-config, use standard Ruby/Bundler commands with Artifactory as the gem source. - Resolution and deployment: Use
--repo-resolvefor installing gems and--repo-deployfor publishing gems. - Run once per project: Re-run when changing repository assignments.
Expected Output
$ jf ruby-config --server-id-resolve=my-server --repo-resolve=ruby-virtual
Ruby build configuration saved successfully.
How to Verify
After running, verify the configuration is applied:
bundle configAfter Configuration
After running jf ruby-config, use standard Bundler commands. JFrog CLI configures the gem source to point to Artifactory, so native commands resolve from it automatically:
# 1. Configure once
jf ruby-config --server-id-resolve=my-server --repo-resolve=ruby-virtual
# 2. Use standard Bundler — dependencies resolve from Artifactory
bundle install
# 3. To publish a gem (if --repo-deploy was configured)
gem push my-gem-1.0.0.gemImportant Notes
- Config-only: There is no
jf rubycommand. After runningjf ruby-config, use standard Ruby/Bundler commands with Artifactory as the gem source. - Resolution and deployment: Use
--repo-resolvefor installing gems and--repo-deployfor publishing gems.
CI/CD Example (GitHub Actions)
# .github/workflows/build.yml
steps:
- uses: actions/checkout@v4
- name: Setup JFrog CLI
uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ vars.JF_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- name: Configure Ruby
run: jf ruby-config --server-id-resolve=setup-jfrog-cli-server --repo-resolve=ruby-virtual
- name: Install dependencies
run: bundle installTroubleshooting
| Symptom | Cause | Fix |
|---|---|---|
bundle install does not resolve from Artifactory after config | Config not applied or gem source not set | Re-run jf ruby-config and verify with bundle config |
| 401 / 403 errors | Invalid credentials or insufficient permissions | Re-run jf config add with a valid access token |
gem push fails | Deploy repository not configured | Re-run jf ruby-config with --repo-deploy set |
Enable debug logging: export JFROG_CLI_LOG_LEVEL=DEBUG
Related Topics
- Build Tools Overview — Capabilities matrix and tool reference
- Native Mode — Supported packages with Native Mode
Updated 8 days ago
