Guide
Setting Up a Rails Server Run/Debug Configuration in RubyMine
Learn how to create a Rails server run/debug configuration in RubyMine, set breakpoints, inspect variables, and recover from common issues.
Published by Tasadduq Burney
10 Nov 2025, 11:39 UTC
3 min116.2K views0

Desired Outcome
Create a RubyMine Run/Debug configuration that starts a local Rails server, allows you to set breakpoints, inspect variables, and stop the server cleanly.
Prerequisites
- RubyMine installed (version 2023.2 or later recommended).
- A Rails project open in RubyMine that contains a
Gemfileandconfig/application.rb. - The Ruby SDK configured via
Settings → Languages & Frameworks → Ruby SDK and Gems. - Network access to bind to
localhost:3000(or another free port).
Procedure
- Open the configuration dialog: From the main menu choose
Run → Edit Configurations…. - Add a Rails Server configuration: Click the
+button, selectRails Serverfrom the list. - Fill in the fields:
Name: e.g.,Dev Server.Ruby SDK: choose the SDK you verified in Prerequisites.Host: keep the defaultlocalhost(or change if you need a different interface).Port: default3000; adjust only if you know the port is free.Environment variables: add any needed vars (e.g.,RAILS_ENV=development) using the…button.
- Apply and close: Click
Apply, thenOK. - Start the server in debug mode: In the toolbar, select the newly created configuration from the dropdown and click the
Debugicon (bug symbol). RubyMine will launch the Rails server and attach a debugger. - Set breakpoints: Open any controller, model, or view file and click the gutter next to a line of code. A red dot indicates a breakpoint.
- Trigger a breakpoint: Open a browser and navigate to
http://localhost:3000(or the host/port you set). When the request hits a breakpoint, execution pauses and theDebugtool window appears, showing frames, variables, and evaluation options.
Expected Checks
- After clicking
Debug, theRuntool window should display the Rails startup log and end with a line like=> Booting Pumaor=> Rails 7.0.4 application starting in development. - The
Debugtool window lists a process ID (PID) and shows aFramespane with your application’s source files. - Hitting a breakpoint pauses execution; you can inspect variable values in the
Variablespane and evaluate expressions in theEvaluate Expressiondialog. - Opening
http://localhost:3000in a browser returns the Rails welcome page or your application’s root route without error. - Running a Rails generator from
Tools → Run Rails Generator(e.g.,rails generate controller welcome index) creates the expected files, confirming the environment is usable.
Recovery Options
- Stop the server: In the
Debugtool window, click theStopbutton (red square) or select the configuration again and chooseStopfrom the dropdown. The console will show the exit code. - Port conflict: If you see an error like
Address already in use - bind(2) for "127.0.0.1" port 3000, change thePortfield in the configuration to a free number (e.g.,3001) and restart. - SDK misconfiguration: If the console shows
Could not find ruby-X.X.X, openSettings → Languages & Frameworks → Ruby SDK and Gems, verify the SDK path, and reapply the configuration.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.