Working with Multiple Projects in RubyMine
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.
In this topic, we’ll consider working with multiple Ruby projects opened in one window.
Imagine that one project is already opened and displayed in the Project View.
To add another project, select File | Open… and choose a folder containing the desired project. In the invoked dialog, select Open in current window, enable Add to currently opened projects and click OK.
RubyMine will show both projects in the Project View.
To delete the project from the Project View, right-click it and select Remove from Project View.
Opening Several Ruby Projects
When you open a folder containing several subfolders, RubyMine detects Gemfiles and displays a message that suggests you to process 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.
Managing Project SDK
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).
Managing Project Structure
For each added project, you can manage its structure in the Project Structure page.
Navigating Through Source Code
Running Commands in Project’s Context
RubyMine provides the Run Anything feature that allows you to run various run/debug configurations, rake tasks, rails generators and so on. Any command launched using Run Anything is run in a context of the current project root directory. To run commands in a context of the required project, select this project in the Project View.