Opening a Rails Project in IntelliJ IDEA
This feature is only supported in the Ultimate edition.
The following is only valid when Ruby Plugin is installed and enabled!
In this section:
- Opening from the Welcome Screen
- Configuring Ruby SDK
- Importing a module and configuring a separate SDK for it
In this tutorial we'll learn how to open already existing Rails project in IntelliJ IDEA for the first time (next time you'll be able to open it in a normal manner) and configure Ruby SDK for it.
Before you start working with Ruby on Rails, make sure that Ruby plugin is installed and enabled. The plugin is not bundled with IntelliJ IDEA.
Also make sure that the following prerequisites are met:
- Ruby SDK is downloaded and installed on your machine.
- The required framework SDKs are downloaded and installed on your machine.
Refer to their respective download and installation pages for details:
Opening from the Welcome Screen
Open IntelliJ IDEA and choose Import Project from the Welcome Screen :
Select the directory of your project:
Then follow the steps of the wizard.
Configuring Ruby SDK
Once you've imported your Rails application, you need to configure a Ruby SDK. To do that, chooseon the menu (or click on the main toolbar).
Then, under the section Project Settings, click Project and specify Ruby SDK to be used:
In the desired SDK is not present in list of the available SDKs, click New, and select Ruby SDK or JRuby SDK:
Then, from the pop-up window, choose the type of SDK to be configured (local, remote or an existing one):
Importing a module and configuring a separate SDK for it
IntelliJ IDEA enables you to import an existing module. This is how it's done:
- In the Modules of the Project Structure dialog, click .
- Choose Import Module from the pop-up menu:
- Specify the directory of the module to be imported, and follow the steps of the wizard.
IntelliJ IDEA enables you to specify an SDK other that the project SDK. To do that, select the imported module, in the Gems tab click , and then select the desired interpreter from the pop-up menu:
You see that the imported module has a different SDK:
Note also that IntelliJ IDEA has correctly detected the Ruby on Rails framework.