Ruby

This guide will show you how to integrate the Doppler CLI into your Ruby application development and debugging workflow inside Visual Studio Code.

Prerequisites

Setup

Ensure you've authenticated the Doppler CLI so secrets can be accessed from your machine:

doppler login

Then configure the Doppler CLI to select which project and environment to fetch secrets from by running the following command from a terminal within Visual Studio Code:

doppler setup

rdbg Ruby Debugger

Make sure you've installed and are using the rdbg Ruby Debugger extension in VS Code and have followed the installation instructions in its README. This is required over the default debugger that comes in the main Ruby extension and it's also now the default that Rails uses out-of-the-box.

Launch Configuration

Update your existing launch configuration by creating or setting command to doppler run -- ruby.

A typical launch configuration object will look like the following:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "rdbg",
      "name": "[Doppler] Debug current file with rdbg",
      "request": "launch",
      "script": "${file}",
      "command": "doppler run -- ruby",
    }
  ]
}

πŸ‘

Awesome Work!

Now you know how to inject Doppler secrets into your Ruby applications when developing with Visual Studio Code.


Did this page help you?