RubyMine 2022.3 Help

Zeus

Zeus is a Rails application preloader that improves boot time and speeds up your development tasks, such as running a server, console, or tests. RubyMine allows you to start the Zeus server manually and automatically, run and debug Rails applications, Rake tasks, and tests on Zeus. Moreover, you can use the Zeus run/debug configuration to run commands with specific parameters: you can pass the required arguments, specify environment variables, and so on.

Prerequisites

Before working with Zeus, make sure that the following prerequisites are met:

Start the Zeus server

After you've installed the 'zeus' gem to the project SDK, you can run the Zeus server.

Start Zeus

  1. From the main menu, select Tools | Run Zeus server.

  2. Wait until RubyMine runs the Zeus server. You can see the progress in the Run tool window.

    Start Zeus Server

    In this window, you can rerun Rerun and stop Stop the server.

    If the Zeus server is running, Rails generators, Rake tasks, and tests are run by default on Zeus. For debugging, you need to run the Zeus server in the debug mode and then run the desired Zeus command (for example, server or rake).

Start Zeus at the IDE startup

After you've started the Zeus server, RubyMine creates the temporary run/debug configuration that runs the zeus start command. You can use this configuration to start Zeus automatically with the IDE.

  1. Save the Start Zeus Server temporary configuration created after running Tools | Run Zeus server.

  2. Press Ctrl+Alt+S to open the IDE settings and select Tools | Startup Tasks.

  3. Click Add and select the Start Zeus Server configuration. Click OK.

Run/debug a Rails application

To run and debug Rails applications under Zeus, you need to create a separate Zeus run/debug configuration for running the zeus server command.

Create the Zeus configuration for running a Rails server

  1. Open the Run/Debug Configuration dialog in one of the following ways:

    • Select Run | Edit Configurations from the main menu.

    • With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector.

      Edit run configurations
    • Press Alt+Shift+F10 and then press 0.

  2. In the Run/Debug Configuration dialog, click Add Alt+Insert in the top left corner and select Zeus Server.

  3. Specify the following settings:

    Run/Debug Configuration Zeus
    • Name: enter the configuration name (Zeus Server in our case).

    • Command: type the server Zeus command.

    Click OK to save the created configuration.

Run a Rails application

  1. Start the Zeus server, as described in Start Zeus.

  2. Run the created Zeus configuration for running a Rails server.

Debug a Rails application

  1. Start the debugging session for the run/debug configuration created to start the Zeus server.

  2. Set breakpoints in your application.

  3. Run the created Zeus configuration for running a Rails server.

Run/debug a Rake task

If the Zeus server is running, Rake tasks are run by default on Zeus. To debug Rake tasks under Zeus, you need to create a separate Zeus run/debug configuration for running the zeus rake command.

Create the Zeus configuration for running a Rake task

  1. Open the Run/Debug Configuration dialog in one of the following ways:

    • Select Run | Edit Configurations from the main menu.

    • With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector.

      Edit run configurations
    • Press Alt+Shift+F10 and then press 0.

  2. In the Run/Debug Configuration dialog, click Add Alt+Insert in the top left corner and select Zeus Server.

  3. Specify the following settings:

    • Name: enter the configuration name.

    • Command: type the rake Zeus command.

    • Arguments: specify the Rake task name (for example, db:migrate).

Debug a Rake task

  1. Start the debugging session for the run/debug configuration created to start the Zeus server.

  2. Set breakpoints in your application.

  3. Run the created Zeus configuration for running a Rake task.

Run/debug tests

Running and debugging tests with Zeus doesn't require creating a separate Zeus configuration that runs the zeus test command. If the Zeus server is running, RubyMine sets it as a pre-load server automatically after running tests.

Run tests

  1. Start the Zeus server, as described in Start Zeus.

  2. Run tests. RubyMine automatically creates a temporary test run/debug configuration with the Use pre-load server option set to Zeus.

Debug tests

  1. Start the debugging session for the run/debug configuration created to start the Zeus server.

  2. Set breakpoints in tests.

  3. Run tests as described in Run tests.

Zeus run/debug configuration

You can specify the following settings for newly created or existing Zeus Server run configuration on the Configuration tab:

Command

Specify the required Zeus command.

Example: start, server, rake, etc.

Arguments

Type the arguments to be passed to the Zeus command specified in the Command field.

Example: db:migrate for the rake command

Environment variables

Specify the list of environment variables as the name-value pairs, separated with semi-colons. Alternatively, click the ellipsis button to create variables and specify their values in the Environment Variables dialog.

Ruby arguments

Specify the command-line arguments to be passed to the Ruby interpreter.

Ruby SDK

Specify the Ruby interpreter used to run a Zeus command. You can choose the project default Ruby SDK, or select a different one from the list of configured Ruby SDKs.

Last modified: 21 December 2022