Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails, Spork and debugger

I use spork with Guard + Rspec but the debugger doesn't work as expected:

  • I added require 'spork/ext/ruby-debug' just after the require 'spork'

  • it properly stops on debugger breakpoints...

  • ... but I can't access irb, it spits: Command is available only in local mode.

Do you know how to get around this?

Thanks,


PS: of course I read this question but it's a bit outdated and doesn't work.

PS2: I'd like to avoid using this.

PS3: : I also posted this as an issue here.

like image 524
apneadiving Avatar asked Nov 16 '11 08:11

apneadiving


2 Answers

Consider using pry, it is so much more awesome. I include it in my spec_helper file (works with Test::Unit too) and can do binding.pry within my tests to essentially pry into objects. Works fine with Guard/Spork/RSpec/Cucumber/Spinach for me.

Pry has long since replaced IRB as my default REPL.

like image 124
Michael De Silva Avatar answered Nov 20 '22 18:11

Michael De Silva


OP's bug report leads here, which advises to turn off interactive mode by starting guard like so:

bundle exec guard -i

This worked for me.

like image 32
fakeleft Avatar answered Nov 20 '22 16:11

fakeleft