RubyMine 2018.1 Help

Working with Multiple Projects in RubyMine


It is common for a developer to work on several projects at once. Keeping that in mind, RubyMine allows working with several projects in separate windows or even in one window. Being opened in different windows, the projects are independent, and cannot share information, except for the Clipboard operations.

But RubyMine also allows you to have one main project within which you can add as many projects as you like in one IDE window. This tutorial aims to show how several projects can be managed in one window.

Opening several projects in one frame

Any opened project may become the main project after another one is added. The main project is always placed at the top of the list of projects in all views and in the Settings/Preferences. So first of all, open the project supposed to be the main one (here learn-rails).

To add another project (app) to the main one, go to File | Open... on the main menu, and in the Open Project dialog select the checkbox Add to currently opened projects under the option Open in current window:

rm open multiple projects

The app project appears in the tree, and if you expand the node, you can see the whole structure of this project. The Ruby SDK related to the project is available as well:

rm open multiple projects sdk

Once the project was added, you can delete it from the list. To remove any project (except the main one), navigate to it in the Project tool window, right-click it and choose the command Remove from Project View:

rm open multiple projects remove from project view

If the window with several projects has been closed, you can reopen it (File | Open Recent).

Managing SDK and gems

To change Ruby SDK for a project, go to the Settings/Preferences and click the page Ruby SDK and Gems. All projects are displayed in the list, each one having its own SDK. Select a project and then select its SDK:

rm open multiple projects SDK for project

To add a new SDK, click add:

All SDKs are available with their gems.

Navigating through the source code

Files from all the opened projects are available for navigation. For example, when navigating to a class (Navigate | Class... or Ctrl+N), the name of a project appears to the right:

rm open multiple projects navigation

Using Rails Generators, Bundler commands, Rake tasks, diagrams, etc.

To invoke any action for a project, such as Rails generator (Tools | Run Rails Generator...), Rake task (Tools | Run Rake Task...), Bundler command (Tools | Bundler), and others, first you need to specify the context.

Selecting a context means that a project is selected in the project tree or a file from this project is opened in the editor and has the focus.

Navigation bar serves a good prompter, as it always shows the context:

rm open multiple projects navbar

For example, select the project before invoking the generator's list:

rm open multiple projects context

Running and debugging

When several projects are opened in one window, run configurations are created with the name of the project as a postfix:

rm open multiple projects run
Last modified: 1 August 2018

See Also