astashov / vim-ruby-debugger

Vim plugin for debugging Ruby applications (using ruby-debug-ide gem)
435 stars 36 forks source link

Debugger terminates #87

Open tomaszwojcik opened 11 years ago

tomaszwojcik commented 11 years ago

Every time I run :Rdebugger I get message Command terminated. Tested with ruby 2.0 and 1.9.3 and mvim 7.4.

Any ideas why it happens?

tomaszwojcik commented 11 years ago

Log file contents (I noticed the rails part, however I want to run debugger for non-rails projects as well):

Vim plugin, 15:28:08: Executing :Rdebugger... Vim plugin, 15:28:08: Initializing Server object Vim plugin, 15:28:08: Stopping, pid is: Vim plugin, 15:28:08: Starting Server, command: "'/Users/twojcik/playground/script/rails' server" Vim plugin, 15:28:08: Executing command: rdebug-vim --file /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger --output /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_output --socket /var/folders/ky/bzrkq4v1661c7wpbvjxj7h4w0000gn/T/vkenQjL/6 --logger_file /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_log --debug_mode 1 --vim_executable mvim --vim_servername --separator ++vim-ruby-debugger-separator++ -- '/Users/twojcik/playground/script/rails' server Vim plugin, 15:28:09: PID: Vim plugin, 15:28:09: Waiting for starting debugger...

astashov commented 11 years ago

Weird. Try to run this command from your logs just from console:

rdebug-vim --file /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger --output /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_output --socket /var/folders/ky/bzrkq4v1661c7wpbvjxj7h4w0000gn/T/vkenQjL/6 --logger_file /Users/twojcik/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_log --debug_mode 1 --vim_executable mvim --vim_servername --separator ++vim-ruby-debugger-separator++ -- '/Users/twojcik/playground/script/rails' server
tomaszwojcik commented 11 years ago

I got no output at all in the console. Maybe it's something with a hanging debugger (it keeps waiting at the end of log)?

astashov commented 11 years ago

Hmm, you should get the PID after executing this command... And you use Rails >= 3.0, right?

tomaszwojcik commented 11 years ago

Yes, I have tested following scenarios, both for ruby 1.9.3 and 2.0 and rails 4.0:

  1. Open vim in dir with file.rb (then do :Rdebugger)
  2. Open vim in rails app dir (and run :Rdebugger)

Both scenarios give me no pid. I launch vim using mvim -v command in the console.

astashov commented 11 years ago

Hmm, and if you just run script/rails server from console, it starts the server correctly?

tomaszwojcik commented 11 years ago

Yes, no problems at all. I also double checked my .vimrc and installation instructions.

astashov commented 11 years ago

That sucks. :( The only thing I could recommend to do - debug rdebug-vim, which is part of 'debugger-xml' gem, and figure out why the PID is not printed as it should (here - https://github.com/astashov/debugger-xml/blob/master/lib/debugger/xml/extensions/vim_server.rb#L42) The problem is somewhere there, not inside vim-ruby-debugger itself.

tomaszwojcik commented 11 years ago

Aww :( I will try to debug that gem (and report if succeed). Thanks for help!

astashov commented 11 years ago

No problem. :) Feel free to create the Pull Request there, if you find the source of the issue.