RubyMine 2019.1 Help

Running Applications

RubyMine allows you to run or debug entire Rails applications or specific Ruby scripts. The universal way to do this is using configured sets of startup parameters - run/debug configurations. For instance, you can specify the following parameters for the Rails run/debug configuration: a server type (such as Puma or Passenger), IP address and port, environment (development by default), and so on.

Run/debug configurations can be created in various ways, for example:

Learn more at Creating and Editing Run/Debug Configurations.

Run an application using a specific run/debug configuration

Use one of the following ways to run a program with a specified Run/Debug configuration:

  • Press Ctrl twice to invoke the Run Anything popup. Start typing the required configuration name, select it from the list, and press Enter.

    Run Anything / run configuration
  • Click the Run button on the toolbar to run the currently selected run/debug configuration.

    Run selected configuration
  • Select the Run | Run (Shift+F10) command from the main menu and select the required configuration.

Run a Ruby script

To run a specified ruby script (for example, script.rb), do one of the following:

  • Press Ctrl twice to invoke the Run Anything popup, type the ruby script.rb command and press Enter.

  • Right-click a script in the editor or project tool window, and select Run 'script'.

The actions above create the temporary run configuration that can be changed and saved. You can also run a Ruby script by creating a run configuration manually and running this configuration as described in Run an application using a specific run/debug configuration.

Configure and run the Rails server

For Rails projects, RubyMine automatically creates the development and production run/debug configurations with corresponding Rails environments. For each configuration, you can specify a server type (such as Puma or Passenger), IP address and port, environment (development by default), and so on. The procedures below show how to configure and run the Rails server.

Change the Rails run configuration

  1. Press Ctrl+Shift+A and start typing Edit Configurations. Select Edit Configurations and press Enter.

    Edit Configurations action
  2. In the invoked Run/Debug Configurations dialog, select the required configuration and specify its settings.

    Run/Debug Configurations dialog

    For example:

    • Server - Specifies a web server for running an application. You might need to install a corresponding gem to the project SDK (for example, the passenger gem for the Passenger server).

    • Environment - Allows you to select the Rails environment.

    • Run browser - Enables opening an application automatically in a default browser.

Run the Rails server

  1. Press Ctrl twice.

  2. Start typing the required configuration name, select it from the list, and press Enter.

    Run Anything / run configuration
  3. Wait until RubyMine starts the Rails server. The Run tool window shows the application's output.

    Run tool window / run Rails application

Rerun an application

To rerun the launched application, do the following:

  1. In the Run tool window, select the tab where the desired application is opened.

  2. In the toolbar of the Run tool window, click the Rerun button (Ctrl+F5).

Stop or pause an application

In the Run tool window, you can stop a program or pause its output. If a program is stopped, its process is interrupted and exits immediately. When program output is paused, the program continues running in the background, but its output is suspended.

Stop an application

  1. In the Run tool window, click the Stop button on the toolbar or press Ctrl+F2.

  2. To close the active tab, click the Close button, or press Ctrl+Shift+F4.

Suspend application output

  • In the Run tool window, click the Pause button on the toolbar.

View running processes

To preview a list of the launched applications, select Run | Show Running List from the main menu. All active applications will be displayed in a popup placed in the top-right corner of the IDE.

Running List

You can click the running process to open the corresponding Run tool window.

Last modified: 9 April 2019

See Also