RubyMine 2026.2 Help

Create files and directories

RubyMine enables you to create arbitrary files or language-specific files. You can create Ruby files, classes or modules, tests, HTML files, stylesheets, JavaScript/TypeScript files, and so on. Such language-specific files can be created with initial content using templates. For example, the RSpec test created from a template contains a skeleton for an example group. If necessary, you can customize these templates or add new ones.

In this topic, we'll show you how to create files and directories, and how to use templates.

Create a Ruby file, class, or module

RubyMine enables you to create Ruby files or generate classes and modules. To create a new Ruby file, class, or module, do the following:

  1. In the Project view Alt+1, select the directory where you want a class to be created, and press Alt+Insert or click the New File or Directory.

    New File or Directory menu
  2. From the popup menu, select Ruby Class/File.

    New Ruby File/Class menu
  3. In the New Ruby Class/File popup, do one of the following:

    • To create a new Ruby file, enter its name and make sure that File is selected.

      New Ruby File/Class dialog
    • To create a Ruby class, switch to Class and specify the class name.

      New Ruby File/Class dialog

      RubyMine allows you to create classes prepended by modules. If required, prepend the class name with the module name:

      New Ruby File/Class dialog

      In this case, the created file will look as follows:

      New class
    • To create a Ruby module, switch to Module and specify the module name.

      New Ruby File/Class dialog
  4. Press Enter.

Create a directory

To create a directory:

  1. In the Project view Alt+1, select the directory where you want a class to be created, and press Alt+Insert or click the New File or Directory.

    New File or Directory menu
  2. Select Directory from the list.

    New Directory menu
  3. In the popup that opens, specify the directory name. To create several nested directories, use slashes as separators, for example, views/shared.

Create an empty file

To create an empty file with an arbitrary extension:

  1. In the Project view Alt+1, select the directory where you want to create a file, press Alt+Insert, and then select File from the list.

  2. In the New File dialog that opens, type the filename and extension. You can type the whole directory structure before the new filename. If the nested directories do not yet exist, they will be created.

  3. If the specified extension is not associated with any file type recognized in RubyMine, the Register New File Type Association dialog opens where you can associate the extension with one of the recognized file types. For more information, refer to File type associations.

Customize the New File or Directory menu

  1. Press Ctrl+Alt+S to open settings and then select Appearance & Behavior | Menus and Toolbars.

  2. Start typing new in the right search bar.

  3. Reorder or remove items as you want them to appear in the New File or Directory menu and confirm the changes.

    Customizing the New File or Directory menu
11 August 2026