RubyMine 2020.2 Help

Chef Support

Chef is a configuration management tool that allows you to automate infrastructure management. In RubyMine, you can work with Chef cookbooks, recipes, and resources. The IDE detects cookbooks automatically and enables code insight features (such as code completion and navigation) for resources and their attributes.

Prerequisites

Before working with Chef cookbooks in RubyMine, make sure that the following prerequisites are met:

Mark a directory as a cookbook

Detect cookbooks automatically

If a directory contains the recipes folder, RubyMine can detect it as a cookbook.

  1. Open a recipe file and start typing.

  2. Click Configure Cookbooks in the invoked popup.

    Configure a cookbook from the editor
  3. In the Configure Cookbooks dialog, select the desired cookbooks and press Enter.

    Configure Cookbooks dialog

Mark a directory as a cookbook manually

  1. Open the Project view Alt+1.

  2. Right-click the desired directory and select Mark Directory As | Cookbook Root.

    Mark a cookbook from the Project view

    To unmark the directory, select Mark Directory As | Unmark as Cookbook Root.

Coding assistance

RubyMine provides the following code insight capabilities for Ruby files inside the recipes folder:

  • Code completion

    Use code completion Ctrl+Space to complete the names of Chef resources, attributes, and attribute arguments.

    Chef completion
  • Navigation

    Navigate to a resource declaration with Ctrl+B.

    Chef navigation
Last modified: 14 August 2020