RubyMine 2018.1 Help

Creating Rails-Based Projects

In this section:


In RubyMine, one can create several Rails-based project types.

  • Rails applications are intended for productive web development with Ruby on Rails.
  • Rails mountable engine projects are used to provide additional functionality to their host applications.
  • Rails API projects are intended for building REST APIs with Rails.
  • RailsApp Sample projects are intended for mastering Rails.

Creating Rails-based projects

To create a Rails-based project, follow these general steps

  1. Do one of the following:
    • On the main menu, choose File | New Project .
    • Click Create New Project on the Welcome screen.

    New Project dialog box opens.

  2. In the New Project dialog box, specify the project name and location. In the left-hand pane, select the desired Rails-based project type.
    rm new project rails
  3. Specify the following:
    • In the Ruby SDK drop-down list, select the Ruby SDK you want to use from the list of available Ruby interpreters, installed on your computer.

      If the desired Ruby interpreter is not found in the list, you can specify a new one by clicking Add Ruby SDK, and locating Ruby SDK in the file system.

    • If you are working with RVM, you have an additional settings:
      rm new rails app with gemset

      When you specify a name for your project, RubyMine automatically suggests a gemset with the same name. Click the link Create to have RubyMine install a gemset for your new project. Leave the checkbox selected, so that the gems are put in this gemset when generating your new project.

    • In the Rails Version drop-down list, select the desired Rails version from those installed on your machine.

      If the desired version is missing, choose Install Rails Gem... command from the drop-down list. RubyMine downloads the list of gems. Next, you have to choose one from the drop-down list in the Install rails gem dialog box:

      rails gem version
    • In the field Rails Template, type the fully qualified path to the desired template file, or click the button browseButton, and locate the template file in the file system.
    • For the Application and Mountable Engine project types, you can select the JavaScript library to be used to generate the target application.
    • For the Application, Mountable Engine or Rails API project types, specify which database will be used for your new application.

      By default, RubyMine suggests using SQLite3. If you want to use a different database, select the Preconfigure for the selected database checkbox, and choose the desired database from the drop-down list.

    • For the Application and Mountable Engine project types, specify whether RubyMine should generate the testing directory structure and template files. To do that, select or clear the checkbox Skip Test::Unit files. If you leave the checkbox cleared, RubyMine will produce the test folder, marked as a test root root_Test.png, with all the necessary infrastructure. If you select this checkbox, the testing infrastructure will not be generated.
    • For the RailsApps Sample, project type select the sample type from the list of available types.

    When ready, click Create. The generator executes and displays its output in the console of the Run tool window.

Creating Rails samples

If you are going to study Rails, choose the option RailsApps Sample. Specify the project locationand Ruby SDK, and then choose the exact sample project.

If there are changes to the list of sample projects, click refresh.

Notes for macOS and Linux users:

  • When choosing the project interpreter, keep in mind that Ruby version may be different from the one provided in the file .ruby-version.
  • If you choose rvm with the a gemset, note that this gemset applies to the file .ruby-gemset.

In both cases, RubyMine provides the ability to revert:

rm RailsAppSamples interpreter
Last modified: 1 August 2018

See Also


Language and Framework-Specific Guidelines: