IntelliJ IDEA 2026.1 Help

Add a Ruby module to your project

This procedure explains how to add a Ruby module to your project, enabling you to run Ruby code seamlessly within your IntelliJ IDEA environment. Following this procedure will ensure that the IDE recognizes your Ruby files, provides code insight, and allows proper execution of scripts and modules.

Before performing the procedure, do the following:

Add a Ruby module

Add a Ruby module

  1. Select the top-level directory in the Project tool window and click on the toolbar or press Alt+Insert.

  2. Select Module.

    Add Module to Project
  3. From the list on the left, select Ruby.

    The IDE will detect and pre-select your Ruby interpreter.

  4. Provide a name for the module.

  5. (Optional) Select Add sample code to add a sample hello.rb Ruby file to the module.

  6. Click the Create button to finish the procedure and close the dialog.

Configuring a Ruby module

Configure a Ruby interpreter for a Ruby module

You can configure a Ruby interpreter other than the one selected when creating the module .

  1. In your project, go to File | Project Structure or press Ctrl+Alt+Shift+S.

  2. Navigate to Modules and select your Ruby module.

  3. On the Ruby Interpreters tab, use one of the following options:

    Selecting an interpreter for a Ruby module
  4. Click OK in the invoked dialog.

02 February 2026