IntelliJ IDEA 2019.1 Help

Running Ruby/Rails-Specific Commands

IntelliJ IDEA 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. IntelliJ IDEA allows you to use a single entry point for various operations - Run anything (Double Ctrl):

bundle install command

Run Ruby/Rails-specific commands

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

  • Ruby scripts

  • Tests (Test::Unit, Rspec, Cucumber, etc.)

  • Rails generators

  • Rake tasks

  • Bundler commands

  • Capistrano commands

  • Rack commands

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, IntelliJ IDEA adds this configuration to temporary configurations.

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

    gem install bundler
Last modified: 13 May 2019