failure running debug-ide with macvim and rvm #69

Closed
wcamarao opened this Issue Apr 29, 2012 · 4 comments

3 participants

@wcamarao

Hi, I'm trying to get vim-ruby-debugger to work with macvim and rvm. When I do :Rdebugger and watch ruby_debugger_output I get this:

~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find ruby-debug-ide (>= 0) amongst [bundler-1.1.3, rake-0.9.2.2] (Gem::LoadError)
from ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from ~/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1230:in `gem'
from ~/.rvm/gems/ruby-1.9.2-p290@ror/bin/rdebug-ide:18:in `<main>'

It finds ruby-debug-ide in the local gemset (p290@ror), but then fails looking for the same gem again in the global gemset. There I have only bundler and rake. The ruby-debug-ide and all other required gems are in the local gemset.

Until some point it was failing to find the ruby-debug-ide at all, so I figured out that I had to manually set macvim $PATH to conform with this local gemset bin folder, since macvim doesn't load dotfiles from ~ where I have rvm automatically doing this job. Even so I still have it trying to look for ruby-debug-ide in the global gemset as the output shows.

I tried to place ruby-debug-ide in the global gemset, then it found but failed looking for other gems (i18n, multi_json and so on). I'd be fine placing ruby-debug-ide in the global but not others which may vary by project.

Any ideas please? I'm very excited to get this working...

@krasdevmeetup

How do you run macvim. Go to the project dir and run mvim from there? Like:

$ cd /path/to/project
$ mvim

Right? In this case it will use all environment variables currently defined in the current terminal session, including rvm, and will use it correctly. Should work in this case. ;)

@astashov
Owner

Whoops, that was me, wrong account. :)

@wcamarao

Hey thanks for that, making some progress here...

Now it seems to be running, see output below

Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.11) listens on 127.0.0.1:39767
/Users/wcamarao/.rvm/gems/ruby-1.9.2-p290@ror/gems/ruby-debug-ide-0.4.16/lib/ruby-debug/command.rb:32: warning: already initialized constant DEF_OPTIONS
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-04-30 09:08:12] INFO  WEBrick 1.3.1
[2012-04-30 09:08:12] INFO  ruby 1.9.2 (2011-07-09) [x86_64-darwin11.3.0]
[2012-04-30 09:08:12] INFO  WEBrick::HTTPServer#start: pid=24235 port=3000

(hiding bunch of rails regular output)

Rails is up and serving, local is also listening on 39767 as I can open a socket on that port. No visible process such as rails or debug-ide though. Might they be running within ruby-debug?

Then I set a breakpoint and reload the page, but it doesn't stop at it. Nothing on output, but this entry in tmp/ruby_debugger:

<breakpointAdded no="1" location="/Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7"/>

When I tried to remove the breakpoint I got this on mvim:

Error detected while processing function 153..223..233:
line    2:
E716: Key not present in Dictionary: debugger_id
E15: Invalid expression: 'delete ' . self.debugger_id
line    3:
E121: Undefined variable: message
E116: Invalid arguments for function 143

Don't know if that's the case, as I saw you saying to other people that we should have two process running...

In addition, complete log below

Vim plugin, 09:08:09: Executing :Rdebugger...
Vim plugin, 09:08:09: Initializing Server object, with variables: hostname: 127.0.0.1, rdebug_port: 39767, debugger_port: 39768, runtime_dir: /Users/wcamarao/.vim/bundle/vim-ruby-debugger, tmp_file: /Users/wcamarao/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger, output_file: /Users/wcamarao/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_output
Vim plugin, 09:08:09: Starting Server, command: "'/Users/wcamarao/.rvm/gems/ruby-1.9.2-p290@ror/bin/rails' s"
Vim plugin, 09:08:09: Trying to kill all old servers first
Vim plugin, 09:08:09: Trying to find PID of process on 39767 port, must_get_pid = 0
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:09: Found pid - 
Vim plugin, 09:08:09: PID - , found by 0 repeats
Vim plugin, 09:08:09: Trying to find PID of process on 39768 port, must_get_pid = 0
Vim plugin, 09:08:09: Trying to find listener of port 39768
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39768 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:09: Found pid - 
Vim plugin, 09:08:09: PID - , found by 0 repeats
Vim plugin, 09:08:09: Servers are killed, trying to start new servers
Vim plugin, 09:08:09: Executing command: rdebug-ide  -p 39767 -- '/Users/wcamarao/.rvm/gems/ruby-1.9.2-p290@ror/bin/rails' s > /Users/wcamarao/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_output 2>&1 &
Vim plugin, 09:08:09: Executing command: ruby /Users/wcamarao/.vim/bundle/vim-ruby-debugger/bin/ruby_debugger.rb 127.0.0.1 39767 39768 mvim VIM "/Users/wcamarao/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger" posix 1 /Users/wcamarao/.vim/bundle/vim-ruby-debugger/tmp/ruby_debugger_log &
Ruby_debugger.rb, 09:08:09 : Starting to connect by TCPSocket with host: 127.0.0.1 and port: 39767
Vim plugin, 09:08:09: Now we need to store PIDs of servers, retrieving them: 
Vim plugin, 09:08:09: Trying to find PID of process on 39767 port, must_get_pid = 1
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:09: Found pid - 
Ruby_debugger.rb, 09:08:09 : Starting to connect by TCPSocket with host: 127.0.0.1 and port: 39767
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:09: Found pid - 
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Ruby_debugger.rb, 09:08:09 : Starting to connect by TCPSocket with host: 127.0.0.1 and port: 39767
Vim plugin, 09:08:09: Found pid - 
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:09: Found pid - 
Vim plugin, 09:08:09: Trying to find listener of port 39767
Vim plugin, 09:08:09: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Ruby_debugger.rb, 09:08:09 : Starting to connect by TCPSocket with host: 127.0.0.1 and port: 39767
Ruby_debugger.rb, 09:08:09 : Connected with 127.0.0.1:39767 by TCPSocket by 3 repeats
Ruby_debugger.rb, 09:08:09 : Start TCPServer with host: 127.0.0.1 and port: 39768
Ruby_debugger.rb, 09:08:09 : Start listening vim-ruby-debugger plugin
Ruby_debugger.rb, 09:08:09 : Start listening rdebug-ide
Vim plugin, 09:08:10: Found pid - 24235
Vim plugin, 09:08:10: PID - 24235, found by 4 repeats
Vim plugin, 09:08:10: Trying to find PID of process on 39768 port, must_get_pid = 1
Vim plugin, 09:08:10: Trying to find listener of port 39768
Vim plugin, 09:08:10: Executing command: lsof -i tcp:39768 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:08:10: Found pid - 24239
Vim plugin, 09:08:10: PID - 24239, found by 0 repeats
Vim plugin, 09:08:10: Server PIDs are: rdebug-ide: 24235, ruby_debugger.rb: 24239
Vim plugin, 09:08:10: Debugger is successfully started
Vim plugin, 09:08:10: Adding 'start' to queue
Vim plugin, 09:08:10: Executing queue
Vim plugin, 09:08:10: Sending a message to ruby_debugger.rb: 'start'
Vim plugin, 09:08:10: Using Vim built-in Ruby to send message
Ruby_debugger.rb, 09:08:10 : Received data from vim-ruby-debugger: start
Ruby_debugger.rb, 09:08:10 : Queue is not empty, we will pass queue to rdebug-ide
Ruby_debugger.rb, 09:08:10 : Putting message to rdebug-ide: start
Ruby_debugger.rb, 09:08:10 : Sending message to vim-ruby-debugger: 
Vim plugin, 09:10:41: Trying to toggle a breakpoint in the file /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7
Vim plugin, 09:10:41: There is no already set breakpoint, so create new one
Vim plugin, 09:10:41: Set breakpoint to: /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7
Vim plugin, 09:10:41: Added Breakpoint object to RubyDebugger.breakpoints array
Vim plugin, 09:10:41: Trying to find PID of process on 39767 port, must_get_pid = 0
Vim plugin, 09:10:41: Trying to find listener of port 39767
Vim plugin, 09:10:41: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:10:41: Found pid - 24235
Vim plugin, 09:10:41: PID - 24235, found by 0 repeats
Vim plugin, 09:10:41: Trying to find PID of process on 39768 port, must_get_pid = 0
Vim plugin, 09:10:41: Trying to find listener of port 39768
Vim plugin, 09:10:41: Executing command: lsof -i tcp:39768 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:10:41: Found pid - 24239
Vim plugin, 09:10:41: PID - 24239, found by 0 repeats
Vim plugin, 09:10:41: Server is running, so add command to Queue
Vim plugin, 09:10:41: Adding 'break /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7' to queue
Vim plugin, 09:10:41: Executing queue
Vim plugin, 09:10:41: Sending a message to ruby_debugger.rb: 'break /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7'
Vim plugin, 09:10:41: Using Vim built-in Ruby to send message
Ruby_debugger.rb, 09:10:41 : Received data from vim-ruby-debugger: break /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7
Ruby_debugger.rb, 09:10:41 : Queue is not empty, we will pass queue to rdebug-ide
Ruby_debugger.rb, 09:10:41 : Putting message to rdebug-ide: break /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7
Vim plugin, 09:11:15: Trying to toggle a breakpoint in the file /Users/wcamarao/Projects/spikes/ror/app/controllers/users_controller.rb:7
Vim plugin, 09:11:15: There is already set breakpoint presented, so delete it
Vim plugin, 09:11:15: Removed Breakpoint object from RubyDebugger.breakpoints array
Vim plugin, 09:11:15: Trying to find PID of process on 39767 port, must_get_pid = 0
Vim plugin, 09:11:15: Trying to find listener of port 39767
Vim plugin, 09:11:15: Executing command: lsof -i tcp:39767 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:11:15: Found pid - 24235
Vim plugin, 09:11:15: PID - 24235, found by 0 repeats
Vim plugin, 09:11:15: Trying to find PID of process on 39768 port, must_get_pid = 0
Vim plugin, 09:11:15: Trying to find listener of port 39768
Vim plugin, 09:11:15: Executing command: lsof -i tcp:39768 | grep LISTEN | awk '{print $2}'
Vim plugin, 09:11:16: Found pid - 24239
Vim plugin, 09:11:16: PID - 24239, found by 0 repeats
@wcamarao

Can you tell me which version of ruby-debug-ide you are using? I'm using 0.4.16 and I think that's the problem. Even when using the regular ruby debugger this version of ruby-debug-ide is not allowing me to stop at any breakpoint.

@wcamarao wcamarao closed this Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment