How do I run a Rails7 app including the js and css watchers in Rubymine ?

I've set up a skeleton Rails 7 app using `esbuild` and `bootstrap` via

rails new mojoknows7 -j esbuild -css bootstrap

I used ruby 3.1.0 and after a bit of wrangling I got the app to work. It is supposed to be run in terminal via


which in turn runs

#!/usr/bin/env bash

if ! command -v foreman &> /dev/null
echo "Installing foreman..."
gem install foreman

foreman start -f

which then runs the following components (web, js, css):

web: bin/rails server -p 3000
js: yarn build --watch
css: yarn build:css --watch

From what I can tell, when I run the Rails server from within Rubymine, it only does the web part - how can I control all 3 components from within rubymine, so that when I start the 'server' all 3 are started and when I stop it all 3 are stopped?




Hello Patrick,

You can create a corresponding Run configuration to run Foreman (, will it cover your needs?


Thank you Olga - I tried that but I got "Gem executable not found" - could that be because I am using rvm ?

I got it working using just a "Shell Script" configuration and running bin/dev directly that way.


Patrick, could you please try specifying the arguments (like `start`) in the corresponding field below the one with the executable name. How does it go?


You can just create new shell script and point executable to your `~/your-rails-project/bin/dev` script. That works as is intended by the rails team, since `./bin/dev` executable is a shell script, not a Gem command. I attached a screenshot.


Thank you all - got it working as a script now !


I have some problems configuring this shell script in Windows with the repo source in WSL 2.
I can't find a valid "interpreter path" to use, and the "script path" must be absolute unfortunately so that means that I have to use the full path to the WSL filesystem which doesn't seem to work...


Well, I solved with a "Gem command" configuration like in this guide:

I had to put foreman in the Gemfile though:

group :development do
gem 'foreman', require: false

This is the configuration:


I got the shell script to work but the debugger doesn't seem to attach. How do I get this to work and enable debugging?


Jdstanhope, it'd be great if you could submit a report on our tracker specifying your steps and providing if possible a project sample for reproduce. 


Jdstanhope If you use the shell script, it can't attach a debugger because it doesn't know if it is a ruby process. These 2 things made it work seamlessly (including attaching the debugger) for me
1. Add Foreman in group development

group :development do
gem 'foreman'

2. Add a Gem command as a run configuration with the following arguments

start -f


Jdstanhope: I got the shell script to work but the debugger doesn't seem to attach. How do I get this to work and enable debugging?

Foreman starts multiple processes in a single CLI. The trick is to manually add the multiple processes as Configurations and then start them together as a "Compound"

1. Edit configurations

2. Add a rails configuration, like usual:

3. Add the second tool that the Procfile is starting as a Gem, in my case: Vite

4. Create a Compound that including these 2 (or more) configurations:

5. Select the Compound configuration and press the debug button:



Uttamkini  method still works. Rails 7.1.3 and Ruby 3.2.2.

From my understanding, this is from a change where Rails 7 moved to Importmap and back to the asset pipeline. I don't understand fully, but the official supported gem dartsass-rails runs a separate process and the watcher process needs to be present to compile the assets in development. 


So Rails 7 apps are created now with bin/dev and a bin/dev runs the foreman gem and the foreman gem creates a Ruby process to run the shell commands in the Procfile.


Please sign in to leave a comment.