> For the complete documentation index, see [llms.txt](https://docs.snyk.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snyk.io/supported-languages/supported-languages-list/ruby.md). Agents can also search and read this documentation through its [MCP server](https://docs.snyk.io/~gitbook/mcp).

# Ruby

Snyk support for Ruby with Snyk Code and Snyk Open Source, including SCM import, CLI and IDE testing, and supported versions

## Applicability and integration

{% hint style="info" %}
Snyk supports Ruby for Snyk Code and Snyk Open Source.
{% endhint %}

Available integrations:

* SCM import
* CLI and IDE: test or monitor your app

## Technical specifications

### Supported versions

Snyk supports the following Ruby versions:

| Ruby main version | Ruby specific version |
| ----------------- | --------------------- |
| `2.4.X`           | `2.4.0` to `2.4.10`   |
| `2.5.X`           | `2.5.0` to `2.5.9`    |
| `2.6.X`           | `2.6.0` to `2.6.10`   |
| `2.7.X`           | `2.7.0` to `2.7.8`    |
| `3.0.X`           | `3.0.0` to `3.0.7`    |
| `3.1.X`           | `3.1.0` to `3.1.7`    |
| `3.2.X`           | `3.2.0` to `3.2.11`   |
| `3.3.X`           | `3.3.0` to `3.3.14`   |
| `3.4.X`           | `3.4.0` to `3.4.13`   |
| `4.0.X`           | `4.0.0` to `4.0.10`   |

### Supported frameworks and libraries

For Ruby, Snyk supports the following frameworks and libraries:

* ActiveRecord
* Connection
* grpc-ruby
* LibXML
* mysql2
* Nokogiri
* OpenSSL
* openai ruby client
* ruby-openai
* rexml
* Ruby on Rails
* sinatra
* sqlite3-ruby

### Supported package managers and registries

For Ruby, Snyk supports [Bundler](https://bundler.io/) as a package manager. All Gemfile and Gemfile.lock files are compatible with the Ruby versions that Snyk supports.

Snyk supports [rubygems.org](https://rubygems.org/) as a package registry.

## Ruby for Snyk Code

For an overview of the supported security rules, visit [Ruby rules](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-code/snyk-code-security-rules/ruby-rules).

For Ruby with Snyk Code, Snyk supports the following file formats: `.erb`, `.haml`, `.rb`, `.rhtml`, `.slm`

Available features:

* Reports
* Interfile analysis

## Ruby for Snyk Open Source

{% hint style="info" %}
Depending on your plan, some features may not be available. For more information, visit [plans and pricing](https://snyk.io/plans/).

Snyk does not support platform-specific packages. If these are present in your `Gemfile.lock`, Snyk can create an invalid Fix PR. If possible, use the non-platform-specific variant of a package.
{% endhint %}

For Ruby with Snyk Open Source, Snyk supports the following file formats: `Gemfile`, `Gemfile.lock`

Available features:

* Fix PRs
* License scanning
* Test your app's SBOM and packages using `pkg:gem` PURLs through the [SBOM test](https://docs.snyk.io/developer-tools/snyk-cli/commands/sbom-test) CLI command

### Bundler support

For Ruby Projects that use [Bundler](https://bundler.io/) to manage dependencies, Snyk supports testing, monitoring, and fixing in the CLI and SCM integrations. Snyk compares the specific dependency versions against the [Ruby vulnerability database](https://snyk.io/vuln?type=rubygems).

Snyk tests all Bundler groups. You cannot exclude specific groups, such as test or development groups.

### Manifest files supported for Ruby

For Ruby, Snyk supports the following manifest files:

* `Gemfile`
* `Gemfile.lock`

Snyk requires both files to be present to correctly test, monitor, and fix Ruby Projects.

### Private gem sources

If your Gemfile needs access to private gem sources, visit [Private gem sources for Ruby configuration](https://docs.snyk.io/scan-fix-and-prevent/scan-with-snyk/snyk-open-source/package-repository-integrations/private-gem-sources-for-ruby-configuration).

Using private gem sources should work normally when you are using the Snyk CLI.

When creating Fix PRs for Ruby Projects using private gem sources, Snyk may need access to the service hosting the gems to update the file correctly.

### Fixing vulnerabilities in your Ruby Projects

{% hint style="info" %}
Snyk does not support Fix PRs for Projects using Ruby versions earlier than 3.1. Upgrade to Ruby 3.1 or later to use Fix PRs.
{% endhint %}

Snyk can fix vulnerabilities by updating vulnerable gems with `bundle lock --update` after it modifies your Gemfile. Snyk follows the rules in your Gemfile as far as possible.

In some scenarios, Snyk cannot upgrade all dependencies to non-vulnerable versions. In this case, update the rules in your Gemfile.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snyk.io/supported-languages/supported-languages-list/ruby.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
