RubyMine 2020.1 Help

Run anything

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):

bundle install command

Invoke the Run Anything dialog

To invoke the Run anything dialog, do one of the following:

  • Double-press Ctrl.

  • Click the run anything button in the toolbar.

  • Press Ctrl+Shift+A, type Run anything and press Enter.

Run Anything popup

In this dialog, you can perform the following actions:

Type a question mark to see hints for the available commands:

Run Anything help

You can also start typing the query to see the available commands and run/debug configurations:

Run Anything command

Use the filter button to configure action groups used for search.

Run/debug an application

To run an application using a specific run/debug configuration, start typing the configuration name, select it, and press Enter:

Run configurations

To debug an application, hold down the Shift key when running a run/debug configuration (the dialog title will be changed to Debug):

Debug configurations

Run Ruby/Rails-specific commands

Run anything allows you to execute various Ruby- or Rails-specific commands, for instance:

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:

  1. First, if offers a list of predefined actions that include available Bundler commands, Rake tasks, Rails generators, etc.:

    bundle install command
  2. 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:

      run ruby script
    • Running the Rspec test:

      run RSpec test
    • Deploying an application using Capistrano:

      run Capistrano command

    You can see that the icon next to the specified command (ruby script, rspec, capistrano) identifies the corresponding run configuration. After running this command, RubyMine adds this configuration to temporary configurations.

  3. If the specified command does not match to any predefined action or a default configuration, RubyMine runs this command in a terminal:

    gem install bundler

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):

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:

open recent project
Last modified: 29 May 2020