llms.txt: machine-readable documentation index. Markdown version of this page is also available.

IntelliJ IDEA 2026.3 Help

Configure a Ruby interpreter

To work with your Ruby code in IntelliJ IDEA, you need to configure at least one Ruby interpreter. IntelliJ IDEA uses the interpreter selected in Project Structure | Project Settings | Modules | Ruby Interpreters to run your code, resolve gems, and provide code insight.

When you open a project for the first time, IntelliJ IDEA can select the interpreter automatically based on the Ruby version specified in the project files. You can also select or change the interpreter manually at any time.

Configuration of the Ruby interpreter depends on the way you installed it:

  • If you installed Ruby using a version manager or Homebrew (on macOS or Linux), IntelliJ IDEA detects interpreters automatically. In this case, you can select the desired version.

  • If you installed Ruby using other package managers (such as apt for Ubuntu) or a Ruby installer (for example, RubyInstaller for Windows), you need to add it manually.

  • If you installed Ruby directly from IntelliJ IDEA, the installed interpreter is set as the default for the current project.

  • If you are using Ruby installed in an isolated environment, such as Docker or a remote machine available over SSH, IntelliJ IDEA allows you to configure it as a remote interpreter.

Automatic interpreter selection for new projects

When you open a project for the first time (for example, a project without the .idea directory), IntelliJ IDEA reads the required Ruby version from the project files and compares it with the interpreters listed in Project Structure | Project Settings | Modules | Ruby Interpreters. This list includes interpreters that IntelliJ IDEA detects on your computer (for example, those installed with Homebrew, rbenv, RVM, asdf, or mise) and interpreters that you added manually.

How IntelliJ IDEA determines the required version

IntelliJ IDEA looks for a required Ruby version in the following order and uses the first one it finds:

  1. Version manager files, such as .ruby-version, .tool-versions (asdf, mise), or .versions.conf (RVM).

  2. The ruby directive in Gemfile or gems.rb. It supports exact versions (ruby "3.3.1"), bounds (ruby ">= 3.1.0"), and pessimistic constraints (ruby "~> 3.3").

How the interpreter is selected

Condition

IntelliJ IDEA action

One interpreter matches

IntelliJ IDEA selects it for the project.

Several interpreters match

IntelliJ IDEA does not select an interpreter and displays the Found configuration issues notification so that you can choose one manually.

No interpreter matches

IntelliJ IDEA does not select an interpreter and displays a notification with the required version. You can choose to have it installed for you or to configure it manually.

No version is specified

IntelliJ IDEA selects the latest installed Ruby.

Add a local interpreter

Add an interpreter

  1. Open the Project Structure dialog Ctrl+Alt+Shift+S and select Modules on the left.

  2. On the Ruby Interpreters page, click the add button and select Interpreter:

    New local interpreter
  3. Provide a path to the Ruby executable, for example:

    • /usr/bin/ruby for Ruby installed on Linux using apt.

    • C:\Ruby33-x64\bin\ruby.exe for Ruby installed on Windows using RubyInstaller.

    IntelliJ IDEA will display the added interpreter along with automatically detected interpreters.

    To remove the interpreter from the list, select it, and click the remove button.

Add an interpreter with custom environment

IntelliJ IDEA allows you to use your custom environment for running any Ruby command from within IntelliJ IDEA. To do this, you need to provide environment variable values or a path to a configuration script when adding a local interpreter.

  1. Open the Project Structure dialog Ctrl+Alt+Shift+S and select Modules on the left.

  2. On the Ruby page, click the add button and select Interpreter with Custom Environment:

  3. In the invoked dialog, provide a path to the Ruby executable as described in Add an interpreter. Then, configure the Custom environment in one of the following ways:

    • Specify the environment variable values directly.

      Example: env API_KEY=123

    • If you use a shell script to load environment variables, you need to provide an absolute path to this script.

      Example: /bin/bash /Users/jetbrains/sample_app/env.sh

    • If you use direnv to load and unload environment variables, pass a path to the directory with the .envrc file to the direnv exec command.

      Example: direnv exec /Users/jetbrains/sample_app

    • If you use Shadowenv to customize your project environment, pass a path to the project directory to the shadow exec command.

      Example: shadowenv exec --dir /Users/jetbrains/sample_app --

    Click OK to add an interpreter.

  4. Select the added interpreter and click OK in the Settings dialog.

Select an auto-detected interpreter

Select an interpreter on the Ruby page

To select an auto-detected Ruby interpreter maintained by the version manager, follow the steps below:

  1. Invoke the Project Structure dialog Ctrl+Alt+Shift+S and select Modules on the left.

  2. Choose the required Ruby interpreter. You can also choose the gemset for the RVM and rbenv version managers.

    Ruby Interpreters
  3. For the selected Ruby interpreter/gemset, you can see the installed gems on the right.

Switch an interpreter using Run Anything

If you use RVM or rbenv to manage local Ruby interpreters, you can quickly set the required interpreter using Run Anything:

  1. Press Ctrl twice.

  2. In the invoked popup, start typing rvm use or rbenv shell, select the required interpreter and press Enter.

  3. (Optional) If necessary, click the Rollback button in the popup that informs about the changed interpreter.

Add a remote interpreter

Various remote development tools, such as Docker, SSH, or Windows Subsystem for Linux (WSL), allow you to use an isolated environment for developing your applications. This can be useful in multiple cases, for example, if you want to:

  • Develop in an isolated environment to avoid impacting your local machine configuration.

  • Run, debug, and test your application on the same operating system you deploy.

  • Develop Linux-deployed applications using the Windows Subsystem for Linux.

You can prepare the required Ruby or Rails setup in a remote environment using Docker, Docker Compose, a remote machine available over SSH, or WSL. Then, you can add the remote Ruby interpreter in IntelliJ IDEA and run, debug, and test your application in an isolated environment right from the IDE.

Note that when you are using a remote interpreter, IntelliJ IDEA downloads gems from a remote machine to a local cache to be able to use code insight features. In this case, you may encounter a situation when new gems were installed on a remote machine outside the IDE. To update a set of gems stored in a local cache, click the Synchronize gems Synchronize gems button in the Ruby Interpreters page.

To configure a remote Ruby interpreter, follow these steps:

  1. On the toolbar, click add, and choose Remote Interpreter or Version Manager.

    New remote interpreter
  2. In the Configure Remote Ruby Interpreter dialog, perform the steps provided on the respective tab below.

    1. Specify the following options:

      Configure remote ruby interpreter: SSH
      • SSH configuration: Expand the list of existing SSH configurations or click the ellipsis button and create a new one.

      • Ruby or version manager path: Specify the path to the Ruby interpreter or the version manager executable.

    2. Click OK. If you specified a path to the version manager executable on the previous step, IntelliJ IDEA suggests selecting the Ruby interpreter used to run a remote application.

    3. On the Ruby page, select the added interpreter and click OK.

    1. In the invoked dialog, select Docker and specify the following options:

      Configure remote Ruby interpreter: Docker
      • Server: Specify a Docker server used to run a container.

      • Image name: Select the previously built image.

      • Ruby or version manager path: Leave the default ruby value to detect a path to the Ruby interpreter automatically.

    2. Click OK. If you specified a path to the version manager executable on the previous step, IntelliJ IDEA suggests selecting the Ruby interpreter used to run a remote application.

      The added interpreter is now available on the Ruby page.

    3. Select the added interpreter and click OK in the Ruby Interpreters dialog.

      Wait until IntelliJ IDEA finishes the project analysis process and creates helper Docker images and containers.

      Docker tool window
    1. In the invoked dialog, select Docker Compose and specify the following options:

      Configure remote Ruby interpreter: Docker Compose
      • Server: this option specifies a Docker server used to run a container.

      • Configuration files: leave the docker-compose.yml file.

      • Service: select the web service.

      • Environment variables: Normally, does not need to be changed.

        If you do want to customize them, click the Edit environment variables icon to open the Environment Variables dialog.

        You can either add a new variable (click the + icon) or edit system environment variables, which are included by default.

        Edit environment variables
      • Node.js runtime path: Leave the default ruby value to detect a path to the Ruby interpreter automatically. You can also manually specify the path to the interpreter or the version manager executable.

    2. Click OK. If you specified a path to the version manager executable on the previous step, IntelliJ IDEA suggests selecting the Ruby interpreter used to run a remote application.

      The added interpreter is now available on the Ruby page.

      Ruby Interpreters: Docker Compose
    3. Select the added interpreter and click OK in the Ruby Interpreters dialog.

      Wait until IntelliJ IDEA finishes the project analysis process and creates helper Docker images and containers.

      Docker tool window: Helpers

(Optional) Edit mappings between local and remote project files

  1. Specify mappings between files of a local and remote project. To do this, click the Edit Path Mappings button.

    Edit path mappings
  2. In the Edit Project Path Mappings dialog, specify the local and remote project root paths.

    Edit Project Path Mappings

    Note that IntelliJ IDEA detects Vagrant synced folders, WSL mappings, and so on. These mappings are listed in this dialog and cannot be changed.

Edit an interpreter

You can customize the names of Ruby interpreters to distinguish them quickly and avoid duplication.

  1. Open the Project Structure dialog Ctrl+Alt+Shift+S and select Modules on the left.

  2. Right-click the required Ruby interpreter and select Edit name.

    Rename parameter in code and Ruby interpreter

    Alternatively, you can select the required Ruby interpreter and use the icon or press Enter.

  3. In the Edit interpreter dialog, provide a new name for the interpreter and click OK.

    Enter a new name for the Ruby interpreter

Create RVM gemsets

To create an RVM gemset, open the Product Structure dialog (Ctrl+Alt+Shift+S), go to Modules | Ruby Interpreters, and perform the following steps:

  1. Right-click the required interpreter and select New RVM gemset

    Ruby Interpreters page
  2. In the dialog that opens, select the Ruby interpreter, for which the gemset will be created. Then, specify the gemset name and click OK:

    create new rvm gemset dialog
  3. The Ruby Interpreters page will show the gemset as a child of the selected interpreter:

    Ruby Interpreters page

    Note that the asterisk is appended to the gemset name. This means that gemset is not created yet. To create it, click Apply or OK in the Product Structure dialog.

Troubleshooting

Configure a local interpreter for a Ruby project

If you encounter issues when configuring a local interpreter for a newly-cloned Ruby project (for example, the Ruby Interpreters page is not displayed), try opening this project from existing sources.

  1. In the main menu, go to File | New | Project from existing sources.

  2. Provide the path to your project.

  3. In the Import Project dialog, select the Create project from existing sources option and click Next.

  4. Specify the project name and path to the directory in which you want to create the project. Click Next.

  5. Select the directories that you want to add to the project roots and click Next.

  6. Select the frameworks that you want to use in your project. Click Finish.

Once IntelliJ IDEA opens your project, follow the steps described in Add an interpreter to configure a local interpreter.

Remove an interpreter

  1. Go to Project Structure | Project Settings | Modules | Ruby Interpreters

  2. From the list of interpreters, select the manually added interpreter you want to remove.

  3. Click the remove button from the toolbar on top of the Ruby page.

    Removing an added interpreter
  4. Click OK in the invoked dialog.

02 November 2026