Private gem sources for Ruby configuration
Note This functionality is currently in beta. Contact Snyk Support to have it enabled for your Organization.
You can add a configuration to tell Snyk where your private gems are hosted. This is the same information you would normally add as a Bundler environment variable.
After you have added this configuration, Snyk uses the information to access private dependencies when creating Pull/Merge Requests, by allowing Bundler to reach those dependencies in order to regenerate the lockfile.
This guide is relevant for Snyk UI integrations only. The CLI supports Ruby Projects with private registries without extra configuration.
- 1.Go to settings> General.
- 2.Find the
RubyGems Bundler environment variablessection (see the screen illustration).
- 3.Add environment variable names and values to define credentials for gem sources. These are generally the same as the values you set on your developer machine, in your CI environments, or both. Example name:
- 4.To test the configuration, open a Pull/Merge Request on a Project that contains gems from your private registries to see a lockfile updated and included in the Snyk Fix Pull Request.
RubyGems Bundler environment variables
A list of requirements follows:
- Variable values must be CGI escaped.
- Gem sources must use
httpsURLs. Example: Supported:
gem "privvy", git: "https://github.com/testexample/ruby-gem-for-private-source"Not supported:
gem "privvy", git: "[email protected]:testexample/ruby-gem-for-private-source"
- Gem sources must be publicly resolvable, that is, not behind a firewall.
Last modified 16d ago