RubyMine provides different ways to run scripts and applications, rake tasks, rails generators, and so on. You can run all of these actions using shortcuts, menu commands or a terminal. RubyMine allows you to use a single entry point for various operations - Run anything (Double Ctrl):
Invoke the Run Anything dialog
To invoke the Run anything dialog, do one of the following:
Click the button in the toolbar.
Press Ctrl+Shift+A, type Run anything and press Enter.
In this dialog, you can perform the following actions:
Run/debug an application for the selected run/debug configuration.
Run Ruby/Rails-specific commands (Rails generators, Bundler commands, Rake tasks, etc.).
Type a question mark to see hints for the available commands:
You can also start typing the query to see the available commands and run/debug configurations:
Use the button to configure action groups used for search.
Run/Debug an application
To debug an application, hold down the Shift key when running a run/debug configuration (the dialog title will be changed to Debug):
Run Ruby/Rails-specific commands
Run anything allows you to execute various Ruby- or Rails-specific commands, for instance:
- Ruby scripts
Tests (Minitest, Rspec, Cucumber, an so on)
- Rails generators
You can also run Rails and IRB consoles, or change the project SDK using commands dependent on the utilized version manager (RVM, rbenv, etc).
Run anything executes commands in the following way:
First, if offers a list of predefined actions that include available Bundler commands, Rake tasks, Rails generators, etc.:
If the specified command is not found in the predefined actions, Run anything tries to match this command to any default run configuration. Below are few examples:
Running the ruby interpreter for a specific script:
Running the Rspec test:
Deploying an application using Capistrano:
You can see that the icon next to the specified command (, , ) identifies the corresponding run configuration. After running this command, RubyMine adds this configuration to temporary configurations.
If the specified command does not match to any predefined action or a default configuration, RubyMine runs this command in a terminal:
Run commands in the current context
Any command launched using Run anything is run in a context of the current project root directory. If necessary, you can run commands in the current context, which can be determined by a project or folder selected in the project tree, a project file currently opened in the editor and has focus, etc.
To launch a command in the current context, hold down the Alt key before running the command (the dialog title will be changed to Run in Context):
This functionality can be useful for launching scratch files because they are placed outside of the project’s root folder.
Open recent projects
The Run anything dialog allows you to reopen recent projects. To do this, type the open command, select the required project in the list and press Enter: