Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RubyMine debugger with Rake?

Using RubyMine 3.0, I set up a Rake configuration to run a Unit Test. Then I set some breakpoints, then ran the Rake task. No breakpoints were hit, the test just executed like normal and then exited.

Does the RubyMine debugger not work through Rake?

like image 512
ep4169 Avatar asked Dec 09 '10 18:12

ep4169


People also ask

What is the difference between Rake and Ruby?

rake is a Make-like program implemented in Ruby. rails is a web framework, which also has some rake tasks. This means that you can have a ruby program with rake but without rails, but not the other way around. By itself, rake will be faster because you don't need to load the whole rails application.

How do I run a Rake file?

Go to Websites & Domains and click Ruby. After gems installation you can try to run a Rake task by clicking Run rake task. In the opened dialog, you can provide some parameters and click OK - this will be equivalent to running the rake utility with the specified parameters in the command line.


2 Answers

Try this:

  1. Go to Run -> Edit Configurations
  2. Expand the Rake node and add new rake configuration for your rake task (if not already done)
  3. Go to Run -> Debug...
  4. Select your configured rake task.
like image 162
Derek Prior Avatar answered Sep 22 '22 12:09

Derek Prior


The above answer is correct. I just want to elaborate on it a little bit, when using a mountable engine. In that case, I had to do the following:

  1. Run > Edit Configuration > Rake

  2. Enter task name e.g. scan_spreadsheet

  3. Change the working directory to your main application or dummy application, not the engine root directory.

  4. If you are using RVM with multiple gemsets, select the second option for Ruby SDK and select the correct gemset

like image 23
Donato Avatar answered Sep 23 '22 12:09

Donato