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:
The 'zeus' gem is installed in the project SDK.
Zeus is initialized.
To run tests, make sure that the gems required for testing are added to the Gemfile and installed in the project SDK.
Start the Zeus server
After you've installed the 'zeus' gem to the project SDK, you can run the Zeus server.
Start Zeus
From the main menu, select
.Wait until RubyMine runs the Zeus server. You can see the progress in the Run tool window.
In this window, you can rerun and 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
orrake
).
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.
Save the Start Zeus Server temporary configuration created after running Tools | Run Zeus server.
Press Ctrl+Alt+S to open IDE settings and select Tools | Startup Tasks.
Click 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
Open the Run/Debug Configuration dialog in one of the following ways:
Select
from the main menu.With the Navigation bar visible ( ), choose from the run/debug configuration selector.
Press Alt+Shift+F10, then press 0 or select the configuration from the popup and press F4.
In the Run/Debug Configuration dialog, click Alt+Insert in the top left corner and select Zeus Server.
Specify the following settings:
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
Start the Zeus server, as described in Start Zeus.
Run the created Zeus configuration for running a Rails server.
Debug a Rails application
Start the debugging session for the run/debug configuration created to start the Zeus server.
Set breakpoints in your application.
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
Open the Run/Debug Configuration dialog in one of the following ways:
Select
from the main menu.With the Navigation bar visible ( ), choose from the run/debug configuration selector.
Press Alt+Shift+F10, then press 0 or select the configuration from the popup and press F4.
In the Run/Debug Configuration dialog, click Alt+Insert in the top left corner and select Zeus Server.
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
Start the debugging session for the run/debug configuration created to start the Zeus server.
Set breakpoints in your application.
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
Start the Zeus server, as described in Start Zeus.
Run tests. RubyMine automatically creates a temporary test run/debug configuration with the Use pre-load server option set to Zeus.
Debug tests
Start the debugging session for the run/debug configuration created to start the Zeus server.
Set breakpoints in tests.
Run tests as described in Perform 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 therake
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.