astashov/vim-ruby-debugger

"VIM not found" debugger wont start server

sdbondi opened this issue · 8 comments

Hi,

I'm using Ubuntu 12.04, ruby 1.9.3p327, vim 7.4, debugger 1.6.1

:echo has("signs") && has("clientserver") && has("ruby") && v:version > 700 returns '1'

Started vim:
vim --servername VIM

ruby_debugger_log

Vim plugin, 12:04:41: Executing :Rdebugger...
Vim plugin, 12:04:41: Initializing Server object
Vim plugin, 12:04:41: Stopping, pid is: 10008
Vim plugin, 12:04:41: Killing server with pid 10008
Vim plugin, 12:04:41: Executing command: ruby -e 'Process.kill9,10008)'
Vim plugin, 12:04:41: Killed server with pid: 10008
Vim plugin, 12:04:41: Starting Server, command: "'/home/stan/.rvm/gems/ruby-1.9.3-p327/bin/rails' s"
Vim plugin, 12:04:41: Executing command: rdebug-vim --file /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger --output /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger_output --socket /tmp/voJF46L/12 --logger_file /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger_log --debug_mode 1 --vim_executable VIM --vim_servername VIM --separator ++vim-ruby-debugger-separator++ -- '/home/stan/.rvm/gems/ruby-1.9.3-p327/bin/rails' s
debugger-xml, 12:04:42 : Executing command: VIM --servername VIM -u NONE -U NONE --remote-send "<C-\>:call RubyDebugger.establish_connection()"
Vim plugin, 12:04:42: PID: 10181
Vim plugin, 12:04:42: Waiting for starting debugger...

My .vimrc

Bundle 'astashov/vim-ruby-debugger'
let g:ruby_debugger_debug_mode = 1
let g:ruby_debugger_default_script = 'rails s'

In ruby_debugger_output I get

sh: 1: VIM: not found


I had another issue earlier where the server wouldn't start and I had to manually create the tmp directory /tmp/vdpXT6K/ to get past that one.

Please help! :)

--vim_executable VIM - that's weird :)
Could you please list your vim-ruby-debugger settings from .vimrc?

Here is my vimrc:
https://github.com/sdbondi/vimrc/blob/master/vimrc#L49

Thanks for getting back :)

That's actually pretty weird you have such a weird executable specified in the ruby-debugger, but I don't see it in the config.

Could you please try to add this to your .vimrc:

let g:ruby_debugger_progname = 'vim'

And try again?

That worked :) The executable is now correct and the server starts, however the breakpoint is still not hit. Here are the logs:

LOG:
Vim plugin, 07:55:33: Executing :Rdebugger...
Vim plugin, 07:55:33: Initializing Server object
Vim plugin, 07:55:33: Stopping, pid is: 6857
Vim plugin, 07:55:33: Killing server with pid 6857
Vim plugin, 07:55:33: Executing command: ruby -e 'Process.kill9,6857)'
Vim plugin, 07:55:33: Killed server with pid: 6857
Vim plugin, 07:55:33: Starting Server, command: "'/home/stan/.rvm/gems/ruby-1.9.3-p327/bin/rails' s"
Vim plugin, 07:55:33: Executing command: rdebug-vim --file /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger --output /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger_output --socket /tmp/v3tzi1W/39 --logger_file /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger_log --debug_mode 1 --vim_executable vim --vim_servername VIM --separator ++vim-ruby-debugger-separator++ -- '/home/stan/.rvm/gems/ruby-1.9.3-p327/bin/rails' s
debugger-xml, 07:55:34 : Executing command: vim --servername VIM -u NONE -U NONE --remote-send "<C-\>:call RubyDebugger.establish_connection()"
Vim plugin, 07:55:34: PID: 6910
Vim plugin, 07:55:34: Waiting for starting debugger...
Vim plugin, 07:55:34: Adding 'start' to queue
Vim plugin, 07:55:34: Executing queue
Vim plugin, 07:55:34: Sending a message to ruby_debugger.rb: 'start'
Vim plugin, 07:55:34: Debugger is successfully started
Vim plugin, 07:55:42: Trying to toggle a breakpoint in the file /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4
Vim plugin, 07:55:42: There is no already set breakpoint, so create new one
Vim plugin, 07:55:42: Set breakpoint to: /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4
Vim plugin, 07:55:42: Added Breakpoint object to RubyDebugger.breakpoints array
Vim plugin, 07:55:42: Server is running, so add command to Queue
Vim plugin, 07:55:42: Adding 'break /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4' to queue
Vim plugin, 07:55:42: Executing queue
Vim plugin, 07:55:42: Sending a message to ruby_debugger.rb: 'break /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4'
Vim plugin, 07:55:52: Trying to toggle a breakpoint in the file /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4
Vim plugin, 07:55:52: There is already set breakpoint presented, so delete it
Vim plugin, 07:55:52: Removed Breakpoint object from RubyDebugger.breakpoints array
Vim plugin, 07:55:54: Trying to toggle a breakpoint in the file /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4
Vim plugin, 07:55:54: There is no already set breakpoint, so create new one
Vim plugin, 07:55:54: Set breakpoint to: /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4
Vim plugin, 07:55:54: Added Breakpoint object to RubyDebugger.breakpoints array
Vim plugin, 07:55:54: Server is running, so add command to Queue
Vim plugin, 07:55:54: Adding 'break /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4' to queue
Vim plugin, 07:55:54: Executing queue
Vim plugin, 07:55:54: Sending a message to ruby_debugger.rb: 'break /home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4'

OUTPUT:
=> Booting WEBrick
=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
[2013-09-12 07:55:43] INFO WEBrick 1.3.1
[2013-09-12 07:55:43] INFO ruby 1.9.3 (2012-11-10) [x86_64-linux]
[2013-09-12 07:55:43] INFO WEBrick::HTTPServer#start: pid=6910 port=3000
[... etc etc normal webrick output...]

cat ruby_debugger

<breakpointAdded no="1" location="/home/stan/Projects/HeyPresto/hey-presto/src/public/app/controllers/home_controller.rb:4"/>

By some reason, rdebug-vim doesn't ping Vim back to tell him that the breakpoint is set.
Could you please run :Rdebugger, then kill rdebug-vim and then run it in a terminal, using the command from the log file? I.e., substitute rdebug-vim with running from Terminal to see if it puts some errors to stdout or stderr. And see if it fails with some error. rdebug-vim is an executable from debugger-xml gem.

Yeah, I definitely should add more error logging to debugger-xml itself... :)

Would probably come in handy, but thanks all the same for the excellent work. As soon as this is working it will be super useful :)

Something strange is happening,

  1. I run vim, run :Rdebugger 'rails s',
  2. Server is working page loads,
  3. kill the pid (checking that its dead),
  4. run the original command, and this one (shortened log paths for convenience)
rdebug-vim --file /home/stan/Projects/code/vimrc/bundle/vim-ruby-debugger/tmp/ruby_debugger --output
ruby_debugger_output --socket /tmp/vrH0z3z/19 --logger_file ruby_debugger_log --debug_mode 1 
--vim_executable vim --vim_servername VIM --separator ++vim-ruby-debugger-separator++ 
-- '/home/stan/.rvm/gems/ruby-1.9.3-p327/bin/rails s'

out comes a PID, but the page wont load and there is no output in the log

What am I doing wrong? ;)

Ah, right, no, it's my fault, it won't work.
Hmm...

Let me try to add some more logging to debugger-xml, and then I'll ask you to update the gem and we'll see what's going on, okay?

Thanks for putting the efforts to launch it, and sorry for these problems

Hey no problem :) Let me know when I can upgrade and thanks for your help so far!