# Create files and directories

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

RubyMine enables you to create arbitrary files or language-specific files. You can create Ruby files, classes or modules,
[tests](create-tests.html#template)
, 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](using-file-and-code-templates.html)
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:

Procedure:

1. In the [Project view](guided-tour-around-the-user-interface.html) `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)), select the directory where you want a class to be created, and press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Ctrl+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) or click the New File or Directory.

![New File or Directory menu](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_file_or_directory_menu.png)

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

![New Ruby File/Class menu](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_ruby_class_menu.png)

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](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_ruby_file_dialog.png)

* To create a Ruby class, switch to Class and specify the class name. ![New Ruby File/Class dialog](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_ruby_class_dialog.png) RubyMine allows you to create classes prepended by modules. If required, prepend the class name with the module name: ![New Ruby File/Class dialog](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_ruby_module_class_dialog.png) In this case, the created file will look as follows: ![New class](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_class_editor.png) > **Tip:** > Note that names of Ruby classes and modules should start with an uppercase letter.

* To create a Ruby module, switch to Module and specify the module name. ![New Ruby File/Class dialog](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_ruby_module_dialog.png)

4. Press `Enter` (Windows), `⏎` (macOS), `⏎` (IntelliJ IDEA Classic (macOS)), `⏎` (macOS System Shortcuts), `Enter` (XWin), `Enter` (GNOME), `Enter` (KDE), `Enter` (Emacs), `Enter` (Sublime Text), `⏎` (Sublime Text (macOS)), `Enter` (Visual Studio), `⏎` (Visual Studio (macOS)), `Enter` (TextMate), `Enter` (NetBeans), `Enter` (Eclipse), `⏎` (Eclipse (macOS)).

## Create a directory

To create a directory:

Procedure:

1. In the [Project view](guided-tour-around-the-user-interface.html) `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)), select the directory where you want a class to be created, and press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Ctrl+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)) or click the New File or Directory.

![New File or Directory menu](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_file_or_directory_menu.png)

2. Select Directory from the list.

![New Directory menu](https://resources.jetbrains.com/help/img/idea/2026.3/rm_new_directory_menu.png)

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:

Procedure:

1. In the [Project view](guided-tour-around-the-user-interface.html) `Alt+1` (Windows), `⌘ 1` (macOS), `⌘ 1` (IntelliJ IDEA Classic (macOS)), `⌘ 1` (macOS System Shortcuts), `Alt+1` (XWin), `Alt+1` (GNOME), `Alt+1` (KDE), `Alt+1` (Emacs), `Alt+1` (Sublime Text), `⌘ 1` (Sublime Text (macOS)), `Ctrl+Alt+L` (Visual Studio), `⌘ ⌥ L` (Visual Studio (macOS)), `Meta+1` (TextMate), `Ctrl+1` (NetBeans), `Alt+1` (Eclipse), `Alt+1` (Eclipse (macOS)), select the directory where you want to create a file, press `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Ctrl+N` (TextMate), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS)), 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](creating-and-registering-file-types.html).

> **Tip:**
> If there are no appropriate file types for the new extension, most likely, you need to install the corresponding repository plugin as described in [Plugins](managing-plugins.html).

## Customize the New File or Directory menu

Procedure:

1. Press `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Meta+Comma` (TextMate), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) 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](https://resources.jetbrains.com/help/img/idea/2026.3/rm_customize_new_file_menu.png)

## See also

