Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA 12 not stopping at breakpoints in rails/ruby

I have IDEA 12 and cannot properly use debugger in Rails/Ruby [a similar question is this one Idea 11 breakpoints & ruby]. When I pressed DEBUG the first time on a rails/ruby app it correctly installed the ruby-debug-base19x and ruby-debug-ide. Issuing a gem list | grep debug shows these gems:

debugger-ruby_core_source (1.2.2)
ruby-debug-base19x (0.11.30.pre12)
ruby-debug-ide (0.4.17.beta16)

The debug [local debug] is starting successfully and I have this in the console:

/home/user/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/user/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-ide-0.4.17.beta16/bin/rdebug-ide --port 55940 --dispatcher-port 37293 -- /home/user/work/IdeaProjects/rails/xtrade/script/rails server -b 0.0.0.0 -p 3000 -e development
Fast Debugger (ruby-debug-ide 0.4.17.beta16, ruby-debug-base19x 0.11.30.pre12) listens on 127.0.0.1:55940
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-06-26 20:53:32] INFO  WEBrick 1.3.1
[2013-06-26 20:53:32] INFO  ruby 1.9.3 (2012-04-20) [x86_64-linux]
[2013-06-26 20:53:32] INFO  WEBrick::HTTPServer#start: pid=32688 port=3000

The only thing is that the breakpoints are never hit. I tried to put breakpoints in Controllers and Views but nothing changed. I tried plenty of times to install uninstall gems but I never managed to have the debugger working in Rails/Ruby. Tried also with the remote debugging but nothing as well.

like image 532
dawez Avatar asked Jun 26 '13 19:06

dawez


People also ask

How do I skip a breakpoint in Intellij?

Ctrl + F8 (Mac: Cmd + F8) Toggle breakpoint.

How do I stop debug in Intellij?

Terminate a debugger sessionClick the Stop button in the Debug tool window. Alternatively, press Ctrl+F2 and select the process to terminate (if there are two or more of them).


1 Answers

The problems was due a usage of a symlink in the project structure [see also this Symlinks confuse debugger for related issue happening in the debugger in Rubymine]

By removing the symlink and using the full path to the files, it fixed the debugger and now Idea12 is stopping correctly in Ruby / Rails code.

like image 110
dawez Avatar answered Jan 02 '23 09:01

dawez