RubyMine 2017.2 Help

Configuring Ruby Interpreter

Introduction

In RubyMine you are not limited to using just any single Ruby interpreter. You are able to implement several and in doing so choose which interpreter you wish to use for any specific project.

  • Standard Ruby interpreters
  • IronRuby
  • MacRuby

Ruby interpreters can be configured on the following levels:

  • Current project: selected Ruby interpreter will be used for the current project.

    Configuring Ruby interpreter on this level is described below.

  • New project: selected Ruby interpreter will be used for the new project instead of the default one.

    Refer to the section Creating Rails-Based Projects for details.

Configuring Ruby interpreter for the selected project

To configure Ruby SDK for the current project, follow these steps:

  1. In the Settings/Preferences dialog box, click Ruby SDK and Gems.
  2. If there is more than one project opened in the same window, select the one you want to define a Ruby interpreter for.
  3. If all the desired Ruby interpreters are already installed and added to your project, select one from the list of Ruby interpreters. To do that, click the radio button to the left of the desired Ruby interpreter, or press Space:
    /help/img/idea/2017.2/rm_list_of_ruby_sdk.png

    If the desired Ruby interpreter is missing from the list of available interpreters, click /help/img/idea/2017.2/add.png.

    • For the *nix platforms, select from the available rvm or rbenv interpreter's and their gemsets, which enables you to switch between the various independent sandboxes. To do that, select the desired interpreter - gemset pair from the list of Ruby interpreters. Refer to RVM Support or Rbenv Support for the details of creating the interpreter - gemset pairs, and to the descriptions of *nix-specific controls. See also Configuring SDK Gemsets page.

      For the non-*nix platforms, choose one from the Select Interpreter Path list, which shows the interpreters that are included in the PATH variable, but has not yet been added to your project.

    • The name of the Ruby interpreter should contain ruby or ir substring. Otherwise, the selected file will not be recognized as the proper Ruby interpreter, and RubyMine will display the following error message:
      The selected file is not a valid home for Ruby SDK.
  4. If you are using JRuby, select version from the Language level drop-down list:
    /help/img/idea/2017.2/rm_jruby_level.png

    Important notes for JRuby users:

    • jruby.bat is no longer supported, since it causes erratic behaviour for tools that try to spawn new ruby instance (e.g. Rake)
    • Language level cannot be selected for JRuby versions 9.0 and higher.
  5. In the Installed Gems section, RubyMine displays the list of gems that are currently installed on your computer. For each of the installed gems, you can view its version and description.

    Note that RubyMine smartly renders gems' documentation.

    If some gems are missing, or outdated, click /help/img/idea/2017.2/add.png or /help/img/idea/2017.2/refresh.png buttons. Refer to the section Resolving References to Missing Gems.

  6. Apply changes.
Last modified: 26 October 2017

See Also