Giter Club home page Giter Club logo

Comments (24)

astashov avatar astashov commented on June 11, 2024

Why are you trying to change default ports from 39767 and 39768 to 3000 and 3001? Just try to leave them as is and connect to localhost:3000.
Anyway, even if you want to change these ports, you shouldn't change them to port of your webserver (3000), because, well, it is busy by webserver. :)
I.e.:
39767 - port of ruby-debug-ide
39768 - port of transmitter of debugger messages (ruby script)
3000 - port of webserver (e.g., webrick).

Please try to run without changing ports and tell me about results.

Thanks! :)

from vim-ruby-debugger.

gorkunov avatar gorkunov commented on June 11, 2024

oh) sorry for my fault.
I changed ports to default:
let s:rdebug_port = 39767
let s:debugger_port = 39768
and started debugger again. Unfortunately result was the same.
And I can't connect to localhost:3000.

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Oh, sorry, you have Rails 3, right? :Rdebugger script/server doesn't work for Rails 3, standard ':Rdebugger 'rails server'' doesn't work too yet (but will work soon :)). Try to use rackup, i.e.:

:Rdebugger '/usr/bin/rackup config.ru'

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Ah. Right, you use :Rdebugger 'script/rails server'. But anyway, it doesn't work yet. Please try to use rackup for now. I will try to fix standard rails way to run Rails next weekend.

from vim-ruby-debugger.

gorkunov avatar gorkunov commented on June 11, 2024

:Rdebugger '/home/gorkunov/.rvm/gems/ree-1.8.7-2010.02@rails3/bin/rackup config.ru'

doesn't help :)

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Damn. Could you please try with Rails 2 for now, to make sure it works and problem is with Rails 3 only (or no)?

from vim-ruby-debugger.

gorkunov avatar gorkunov commented on June 11, 2024

in rails2.3.8 all the same :(

maybe plugin conflict with other?

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Did you try Rails 2.3.8 with default Ruby (not rvm)?

from vim-ruby-debugger.

gorkunov avatar gorkunov commented on June 11, 2024

without rvm plugin doesn't find ruby-debug-ide but it installed as local:


gorkunov@HAMPTON:~$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
linecache (0.43)
rack (1.1.0)
rails (2.3.8)
rake (0.8.7)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.10)

from vim-ruby-debugger.

gorkunov avatar gorkunov commented on June 11, 2024

I found solution.
In the "vim_debugger.vim" I commented lines 161-186 (and 'end' for commented if). So, now ruby-code is invoked as external script and it works ok. I checked breakpoints and they work fine.

Maybe something wrong with ruby-extenstion for vim 7.2.320? (default package in ubuntu 10.04)

from vim-ruby-debugger.

BrenCam avatar BrenCam commented on June 11, 2024

FWIW I've also run into this problem and gorkunov's solution also worked for me. For some reason the ruby-debug-ide is not getting recognized even though it is installed - not sure why?

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Hmm, no idea, and I don't know how to repeat that. :(
Anyway, I'll add some flag to disable this and add note to vim-ruby-debugger to "Troubleshooting" section.
Thank you guys for solving (well, working around :)) that bug!

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

What is the status of this? Things seem to have changed in the ruby_debugger.vim file, and the lines mentioned above don't make sense. Can a patch be posted with the solution, or did the flag get entered into the code? I can't run the debugger with rails 3.

I assume that running :Rdebugger 'rails server' is supposed to start the server on port 3000, as well as the rdebug listener on its own port?

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

@simmerz:
You don't have to edit lines in the ruby_debugger.vim, you have to add
let g:ruby_debugger_builtin_sender = 0
to your .vimrc. Not sure it will help you though, you should better update your vim-ruby-debugger version to the last one, set
let g:ruby_debugger_debug_mode = 1
in your .vimrc, try to run the server and e.g. set a breakpoint and send me your log file from ~/.vim/tmp/ruby_debugger_log then.

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

@astashov http://pastebin.com/ZM8DHEY1

It does now appear to run the server, but it doesn't break. I'm running :Rdebugger 'rails s'

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Aha, I see how it runs 'rails s', how it adds a breakpoint, then rdebug-ide responds that breakpoint was successfully added. (btw, why do you run /sbin/stop?)

What do you do next? You open the page with home_controller.rb in the browser and it isn't stopped on the breakpoint you set, right?

Also, could you please try to run :Rdebugger and only then place a breakpoint and send me logs?

Thanks!

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

I didn't run /sbin/stop! I opened the page with the breakpoint of the first line inside the method (def index; @search = Search.new; end) and it doesn't stop, and instead shows me the page. Even if I put a "puts 'foo'" after that @search = line, it outputs "foo".

http://pastebin.com/bj4x5tHe

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

Oh, I know where that stop command came from. I ran Rdebugger stop :D

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Hmm, it's strange - by some reason ruby_debugger.rb sends message to rdebug-ide, but rdebug-ide doesn't respond by confirmation . Could you please repeat again, and then also send ruby_debugger_output and ruby_debugger?

(BTW, you use Ruby 1.8.7, don't you?)

Thanks!

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

Yes, using Ubuntu's Ruby 1.8.7

ruby_debugger doesn't exist and ruby_debugger_output is here: http://pastebin.com/s3gT5dah

ruby_debugger_log: http://pastebin.com/D5pkgdrx

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

By some reason rdebug-ide doesn't respond.

Could you please also try :Rebugger 'script/rails server'?

If it doesn't work too, could you please test it manually? For this, open a terminal, go to the app's root dir and run:
$ rdebug-ide -p 39767 -- '/usr/bin/rails server'
Then, open another terminal window, and run irb there. Try to execute these commands:

>> require 'socket'
=> true
>> a = TCPSocket.open('127.0.0.1', 39767)
=> #<TCPSocket:0x10171dfe8>
>> a.puts(%q[start])
=> nil
>> a.puts(%q[break /home/simmerz/Projects/247seas/thewaypoint/app/controllers/home_controller.rb:5])
=> nil
>> b = select([a], nil, nil)
=> [[#<TCPSocket:0x10171dfe8>], [], []]
>> b[0][0].recv(1000)
=> "<breakpointAdded no=\"1\" location=\"/home/simmerz/Projects/247seas/thewaypoint/app/controllers/home_controller.rb:5\"/>"

If you receive <breakpointAdded>, then it means rdebug-ide responds successfully.
You should be able to open the page in the browser with your breakpoint and then execute these commands in irb session:

>> b[0][0].recv(1000)
=> "<breakpoint file=\"/home/simmerz/Projects/247seas/thewaypoint/app/controllers/home_controller.rb\" line=\"5\" threadId=\"3\"/>"

<breakpoint> means it was successfully stopped at the breakpoint.

Can you try to repeat that?

Thanks!

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Also, could you please run:
$ ps -ef | grep ruby
and make sure the 'ruby_debugger.rb' and 'rdebug-ide' processes are there. If you don't see the rdebug-ide process, but see usual ruby process which is running Rails server, please try to run debugger by
:Rdebugger 'script/rails server'

Thanks!

from vim-ruby-debugger.

simmerz avatar simmerz commented on June 11, 2024

We have success. :Rdebugger 'script/rails server' seems to work :)

Tom

from vim-ruby-debugger.

astashov avatar astashov commented on June 11, 2024

Hooray! I've just met the same issue you met before - the strange thing - if you open "rdebug-ide -- /usr/bin/rails server", rdebug-ide will be converted to usual "/usr/bin/rails server" (as you can see in the processes list, ps -ef). That is pretty strange behavior of the rdebug-ide gem, and for now I've got no idea why it happens.

from vim-ruby-debugger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.