RubyMine 2026.2 Help

Tutorial: Debug JavaScript in a Rails application

RubyMine allow you to debug client-side JavaScript code in a Rails application. In this tutorial, we'll show you how to debug JavaScript in Chrome. We'll use the Rails application created with esbuild in this tutorial.

Enable the JavaScript debugger

To debug JavaScript, enable automatic startup of the JavaScript debugger in the run/debug configuration of your application.

  1. Open the project that you created in this tutorial or create it following the instructions provided there.

  2. Go to Run | Edit Configurations and select the automatically created development configuration in the Rails group.

  3. Specify the following options:

    Enable JavaScript debugger in Rails
    • Enable the Run browser option and specify http://127.0.0.1:3000. This URL opens the app/views/welcome/index.html.erb view that uses the JavaScript asset.

    • Enable Start JavaScript debugger automatically when debugging.

Start debugging

To debug the JavaScript code, follow the steps below:

  1. Open app/javascript/hello.js and set a breakpoint on the line that calls alert.

    Set a breakpoint
  2. To start debugging, press Ctrl twice and start typing the name of the Development configuration. Select the configuration, press and hold Shift (the dialog title changes to Debug), and press Enter.

  3. On the opened http://127.0.0.1:3000 page, click Hello!. The debugger pauses at the breakpoint and enables you to examine the application state. To learn more, refer to Debug JavaScript in Chrome.

    Examine a suspended program
25 August 2026