Projects
Whatever you do in RubyMine, you do that in the context of a project. A project is an organizational unit that represents a complete software solution. It serves as a basis for coding assistance, bulk refactoring, coding style consistency, and so on.
A project in RubyMine is represented in the Directory Based Format. A root project directory contains the .idea directory, with the following files:
.iml file that describes the project structure.
workspace.xml file that contains your workspace preferences.
A number of xml files. Each xml file is responsible for its own set of settings, that can be recognized by its name: projectCodeStyle.xml, encodings.xml, vcs.xml, and so on.
Thus, for example, adding a new run/debug configuration and changing encoding will affect two different xml files. This helps avoid merge conflicts when the project settings are stored in a version control system and modified by the different team members.
The .idea directory is not visible in the Project view of the Project tool window Alt+1.
Once you have opened a folder in RubyMine, the .idea subfolder is added to it where RubyMine stores its internal configuration settings, for example, for the project code style or the version control system.
In this section:
A project in RubyMine is a folder with the source code you edit, various application configuration files (for example, Gemfile or package.json), and the external libraries. It serves as a basis for coding assistance, refactoring, coding style consistency, and so on.
In this topic, we'll show you how to create new projects, open and close projects, and work with several projects in one window.
Create projects
Create an empty Ruby project
Click Create New Project on the Welcome screen or select from the main menu.
In the dialog that opens, select Empty Project in the left-hand pane and specify the following settings:
Location: Specify a project's location and name (ruby-helloworld in our case).
Ruby SDK: Select a required Ruby interpreter installed on your system.
Click Create.
(Optional) In the opened dialog, choose whether you want to attach a new project to the opened one, open a new project in a new window, or close the current project and reuse the existing window.
Check out a project from Version Control
Click Get from Version Control on the Welcome screen or select from the main menu.
In the invoked dialog, select your version control system from the list and specify the repository to check out the application sources from. Click Clone.
(Optional) In the opened dialog, choose whether you want to attach a new project to the opened one, open a new project in a new window, or close the current project and reuse the existing window.
Open projects
RubyMine lets you open several projects simultaneously in different windows. By default, each time you open a project while another one is opened, RubyMine prompts you to choose whether to open the project in the same window or a new one. If necessary, you can change this behavior later.
Open a project
Click Open on the Welcome screen or select from the main menu.
In the dialog that opens, select the directory that contains the desired project.
(Optional) In the opened dialog, choose whether you want to attach a project to the opened one, open a project in a new window, or close the current project and reuse the existing window.
Attach: In this case, a newly opened project shares the window with the already opened project. This can be useful when one project uses another.
New Window: If you selected New Window, a new project is opened in its own window. In this case, projects are independent and do not share any information. You can switch between projects using the menu.
This Window: In this case, RubyMine closes the current project and uses the existing window for a newly opened project.
Switch between open projects
To switch between open projects, you can use the following commands of the
menu:Ctrl+Alt+]
Ctrl+Alt+[
Configure the project opening
In the Settings/Preferences dialog (Ctrl+Alt+S), go to .
Select one of the following options:
Open project in new window: open a new RubyMine window each time a new project is opened.
Open project in the same window: stay in the same RubyMine window.
Confirm window to open project in: keep the default behavior and display a dialog to choose how to open each new project.
Open multiple projects in one window
RubyMine allows you to work on multiple projects simultaneously. You can open several projects in two ways.
In separate windows
In this case, projects are independent and do not share any information.
In one window
This can be useful when one project uses another.
Attach a new project to the main one
Imagine that one project is already opened and displayed in the Project view.
To add another project:
Select
and choose a folder containing the desired project.In the invoked dialog, click Attach.
RubyMine will show both projects in the Project view.
Open several projects
When you open a folder containing several subfolders (including nested subfolders), RubyMine detects Gemfiles and displays a message that suggests processing subfolders as Ruby projects.
Click Configure... and select the projects to be created for each Gemfile found.
Check Don't ask again to disable automatic Gemfile detection. If necessary, you can enable the Create projects for new Gemfiles option to process folders with new Gemfiles as Ruby projects automatically.
To create a project later manually, right-click a corresponding folder in the Project view and select Mark Directory as | Ruby Project Root. Note that this command is available only for projects containing Gemfiles.
Work with projects in a shared window
For all added projects, you can manage Ruby SDK separately on the Ruby SDK and Gems page of the Settings/Preferences dialog Ctrl+Alt+S.
When you navigate through the opened projects (for example, Ctrl+N), the project name appears to the right.
You can run commands in the context of the required project by selecting this project in the Project view.
For each added project, you can manage its structure in the Project Structure page.
Detach a project from a shared window
To delete the attached project from the Project view, right-click it and select Remove from Project View Delete.
Reopen recent projects
RubyMine keeps the history list of the recent projects, from which you can select the desired one. When RubyMine starts, the most recent project reopens by default. You can change this behavior on the Reopen last project on startup option.
page using theReopen a recent project
Do one of the following:
From the main menu, select
and select the desired project from the list.Press Ctrl and type Open in the invoked popup. Then select the required project from the list and press Enter.
On the Welcome screen, click the desired project in the left-hand pane where the list of your recent projects is shown. You can type in the Welcome screen to filter the list of recent projects.
(Optional) In the opened dialog, choose whether you want to attach a new project to the opened one, open a new project in a new window, or close the current project and reuse the existing window.
Remove a project from the list of recent projects
Select
from the main menu.Click the closing icon for the project to remove.
The selected project will be removed from the list of the recent projects and won't appear on the Welcome screen.
Organize projects into groups
RubyMine allows you to organize projects into specified groups. You can create a new group by right-clicking the list of recent projects and selecting New Project Group.
To move a project into a group, right-click this project, select Move to Group, and choose the required group to place the project in.
Close projects
If you need to close only one project, you can either close the project window or select
from the main menu.If you work with multiple projects, use the following actions to close many projects at once:
Close all projects
From the main menu, select
.This action closes all projects that are currently opened in RubyMine.
Close all but the current project
From the main menu, select
.This action closes all opened projects except the current one.