Working with Multiple Projects in RubyMine
In this section:
- Opening several projects in one frame
- Managing SDK and gems
- Navigating through the source code
- Using Rails Generators, Bundler commands, Rake tasks, diagrams, etc.
- Running and debugging
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
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:
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:
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:
To add a new SDK, click :
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 ( or Ctrl+N), the name of a project appears to the right:
Using Rails Generators, Bundler commands, Rake tasks, diagrams, etc.
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:
For example, select the project before invoking the generator's list:
Running and debugging
When several projects are opened in one window, run configurations are created with the name of the project as a postfix: