IntelliJ IDEA 2017.3 Help

Opening a Rails Project in IntelliJ IDEA

This feature is supported in the Ultimate edition only.

In this section:

Introduction

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.

Prerequisites

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:

/help/img/idea/2017.3/ij_welcomeScreen.png

Select the directory of your project:

/help/img/idea/2017.3/ij_select_project_dir.png

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, choose Project Structure... on the File menu (or click /help/img/idea/2017.3/projectStructure.png on the main toolbar).

Then, under the section Project Settings, click Project and specify Ruby SDK to be used:

/help/img/idea/2017.3/ij_configure_ruby_sdk.png

In the desired SDK is not present in list of the available SDKs, click New, and select Ruby SDK or JRuby SDK:

/help/img/idea/2017.3/ij_configure_ruby_sdk_new.png

Then, from the pop-up window, choose the type of SDK to be configured (local, remote or an existing one):

/help/img/idea/2017.3/ij_configure_ruby_sdk_new1.png

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:

  1. In the Modules of the Project Structure dialog, click /help/img/idea/2017.3/add.png.
  2. Choose Import Module from the pop-up menu:
    /help/img/idea/2017.3/ij_import_ruby_module.png
  3. 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 /help/img/idea/2017.3/add.png, and then select the desired interpreter from the pop-up menu:

/help/img/idea/2017.3/ij_import_ruby_module2.png

You see that the imported module has a different SDK:

/help/img/idea/2017.3/ij_import_ruby_module3.png

Note also that IntelliJ IDEA has correctly detected the Ruby on Rails framework.

Last modified: 11 October 2017

See Also

Language and Framework-Specific Guidelines:

External Links: