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?
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:
Run > Edit Configuration > Rake
Enter task name e.g. scan_spreadsheet
Change the working directory to your main application or dummy application, not the engine root directory.
If you are using RVM with multiple gemsets, select the second option for Ruby SDK and select the correct gemset
The Edit/Debug Configurations tab can be a littRuby Argumentsle confusing when setting up rake tasks. I will assume you followed this approach:
Run > Edit Configurations
Select Rake from the List and select the + button (Add New Configuration)
You are greeted with a Configuration tab:
Name
The name attribute just assigns a unique name Ruby Argumentsfor this task. You can call it whatever you want.
Task Name
This one is important for rake tasks. This specifies the name of the rake task to be executed. So let's say you wanted to run "rake db:migrate" in debug mode, then for the task name here, you would put "db:migrate" without the quotes.
Turn on invoke/execute tracing, enable full backtrace (--trace)
This option is useful to turn on the standard rake --trace option.
Ruby Arguments
The other useful option is to specify the arguments to be passed to the Ruby interpreter.
Those are the main options. Now you can use Run > Debug and it will stop at breakpoints in the rake task itself.