Rubymine running Rails with Foreman

notapatch

not-a-patch

Posted on March 25, 2022

Rubymine running Rails with Foreman

Rails 7 has made foreman the standard way of running Rails. Rubymine's default project configuration will only start the Rails server and not the additional applications in the Procfile.dev. The Rubymine documentation solves the problem with RVM and gemsets but what if you don't use RVM? How can you get Rubymine to start via Foreman?

At the command line make sure you have foreman. You should not add foreman to the Gemfile!.

gem install foreman

You then create a new configuration for running or debugging the application. RubyMine doesn't have a configuration for Foreman so we will have to make it ourselves.

  1. In the main menu, go to Run | Edit Configurations, click the Add icon, and select Gem Command from the list.

  2. In the Run/Debug Configurations dialog, specify the following settings:

Run/Debug Configurations dialog configured for foreman

  • Name: Enter the run/debug configuration name, for example, foreman start.
  • Gem name: Specify the foreman gem here.
  • Executable name: Select the foreman executable.
  • Arguments: Specify an argument for running the application using Foreman, for example, start.

Click on Bundler

Run/Debug Configurations dialog Bundler tab

  • Disable bundle exec
    • bundle exec stops you finding Gems outside of the Gemfile bundle. If you've followed the instructions faithfully then foreman won't be in the bundle.

Click OK.

You should now be able to run the foreman start configuration from within Rubymine.

References

Foreman manual
Bundler - bundle exec

Thanks

Thanks to the Reddit Rails community and jakefillsbass for the tip!

💖 💪 🙅 🚩
notapatch
not-a-patch

Posted on March 25, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Rubymine running Rails with Foreman
rubymine Rubymine running Rails with Foreman

March 25, 2022