

In the invoked Run/Debug Configurations dialog, select the Development configuration under the Rails node. Select Edit Configurations and press Enter. Press Ctrl+Shift+A and start typing edit configurations.

To stop the application, click Ctrl+F2 on the toolbar.īefore running a debugging session, let's examine startup settings related to Docker Compose: Open a browser, enter the 0.0.0.0:3000 address, and press Enter to see our working application. Select the Development configuration on the toolbar and click Shift+F10. Let's run our application before debugging to see how it works: If you don't see rake db:create in the dropdown, try to reload Rake tasks: Reload Rake tasks.įinally, to migrate the database, press Ctrl twice, type db:migrate, select rake db:migrate in the dropdown and press Enter.

Leave the default settings in the invoked Execute 'db:create' dialog and click OK. Select rake db:create in the dropdown and press Enter. Specify how the IDE analyzes the Ruby environment by running specific commands inside a container.ĭocker-compose exec if the project is up, otherwise docker-compose runĭocker-compose exec, run the project with docker-compose up if requiredĭocker exec in an SDK container, create the SDK container if requiredīefore debugging our Rails application, we need to create the database and run migrations. Open the Settings/Preferences dialog Ctrl+Alt+S, go to the Languages & Frameworks | Ruby Docker Integration page. You can select whether to execute these commands in a target container ( docker-compose exec), create a new environment ( docker-compose run), or use the dedicated service container for this purpose. To work with the Ruby interpreter inside Docker, the IDE analyzes the Ruby environment by running specific commands inside a container, such as which ruby, gem env, and rbconfig. (Optional) Configure Ruby Docker integration rb scripts that RubyMine uses to prepare the test environment, convert the output of test libraries (for example, Minitest, RSpec, Cucumber), launch tests, and so on. Ruby helpers are additional containers and Docker images that RubyMine creates for testing and debugging purposes. Wait until RubyMine finishes the indexing process and creates helper Docker images and containers. Select the added SDK in the Ruby SDK and Gems page and click OK. You can also manually specify the path to the interpreter or the version manager executable. Ruby or version manager path: leave the default ruby value to detect a path to the Ruby interpreter automatically. Server: this option specifies a Docker server used to run a container.Ĭonfiguration files: leave the docker-compose.yml file. In the invoked dialog, select Docker Compose and specify the following options: Open the Settings/Preferences dialog Ctrl+Alt+S, go to the Languages & Frameworks | Ruby SDK and Gems page.Ĭlick and select Remote Interpreter or Version Manager. (Optional) Specifying how the IDE interacts with Docker to analyze the Ruby environment. If necessary, you can change this behavior and use another way to analyze the Ruby environment.Ĭlick in the gutter and wait until Docker Compose pulls/builds the images and starts containers.Īlternatively, you can run the docker-compose up command in the RubyMine terminal.Ĭonfigure Compose as a remote interpreterĬonfiguring Docker Compose as a remote interpreter consists of two parts:Ĭonfiguring the remote interpreter itself In case the web service is not running, RubyMine runs it automatically with docker-compose run. We need the web service running because RubyMine uses the docker-compose exec command to analyze the Ruby environment and add Docker Compose as a remote interpreter.
