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.
Before working with Chef cookbooks in RubyMine, make sure that the following prerequisites are met:
Install the Chef plugin as described in Install plugins.
Add the chef gem to the project's Gemfile and install it to the project SDK.
Mark a directory as a cookbook
Detect cookbooks automatically
If a directory contains the recipes folder, RubyMine can detect it as a cookbook.
Open a recipe file and start typing.
Click Configure Cookbooks in the invoked popup.
In the Configure Cookbooks dialog, select the desired cookbooks and press Enter.
Mark a directory as a cookbook manually
Open the Project view Alt+1.
Right-click the desired directory and select.
To unmark the directory, select.
RubyMine provides the following code insight capabilities for Ruby files inside the recipes folder:
Use code completion Ctrl+Space to complete the names of Chef resources, attributes, and attribute arguments.
Navigate to a resource declaration with Ctrl+B.