Ruby Debug Not Working

1 view
Skip to first unread message

Eric J

unread,
Jan 17, 2009, 5:18:17 PM1/17/09
to Ruby on Rails: Talk
I installed ruby-debug using this command:
sudo gem install ruby-debug -y

and then added the line to config/environments/development.rb:
require "ruby-debug"

I restarted webrick and put 'debugger' in my code and tried to access
the page with the debugger command, but it didn't do anything. I've
tried several times and restarted webrick, to no avail.

rails 2.1.1
ruby1.8.6
ruby-debug-0.10.3


Eric

Fernando Perez

unread,
Jan 18, 2009, 8:13:27 AM1/18/09
to rubyonra...@googlegroups.com

Where did you put the require statement and where did you put the
debugger method for instance?

--
Video training screencasts at http://www.digiprof.fr
--
Posted via http://www.ruby-forum.com/.

Eric J

unread,
Jan 18, 2009, 9:21:08 AM1/18/09
to Ruby on Rails: Talk
I put require "ruby-debug" at the top of config/environments/
development.rb. I just tried moving it to the bottom of the file and
that didn't seem to help either.

I put the command 'debugger' at the start of one of my controller
methods, so it should hit the controller and then call debugger.



On Jan 18, 7:13 am, Fernando Perez <rails-mailing-l...@andreas-s.net>
wrote:
> Eric J wrote:
> > I installedruby-debugusing this command:
> >   sudo gem installruby-debug-y

Teedub

unread,
Jan 18, 2009, 9:27:38 AM1/18/09
to Ruby on Rails: Talk
I think you need mongrel for debug
try
script/server mongrel

Eric J

unread,
Jan 18, 2009, 10:54:17 AM1/18/09
to Ruby on Rails: Talk
I installed mongrel and tried it, but no debugging luck. I tried
adding Debugger.start after the 'require "ruby-debug"'.

Is there a debug flag that you need to add to the start up command?

Eric J

unread,
Jan 18, 2009, 11:20:24 AM1/18/09
to Ruby on Rails: Talk
Well it started working, so maybe it was mongrel!

Thanks for your help guys.



On Jan 18, 8:27 am, Teedub <twscann...@gmail.com> wrote:

James Byrne

unread,
Jan 18, 2009, 6:29:25 PM1/18/09
to rubyonra...@googlegroups.com
Eric J wrote:
> I installed mongrel and tried it, but no debugging luck. I tried
> adding Debugger.start after the 'require "ruby-debug"'.
>
> Is there a debug flag that you need to add to the start up command?

script/server --debugger

Xuan

unread,
Jan 19, 2009, 5:13:05 PM1/19/09
to Ruby on Rails: Talk
You can debug with webrick as well: as James Byrne stated, you must
add --debugger when you run the webrick server.
Also you don't actually need to add the require statement neither
Debugger.start if you are using rails 2.x . 'debug' keywords will also
be ignored if you aren't running server with '--debugger', though it
can be a danger in rails 1.x apps; 'debug' statements will throw an
error unless ' require "ruby-debug" ' is added.. and even in that case
the server, at least webrick, will stop on the debug breakpoint even
if you run a production server.

Daniel Tinivella

unread,
Apr 7, 2009, 12:00:17 AM4/7/09
to rubyonra...@googlegroups.com
James Byrne wrote:
> Eric J wrote:
>> I installed mongrel and tried it, but no debugging luck. I tried
>> adding Debugger.start after the 'require "ruby-debug"'.
>>
>> Is there a debug flag that you need to add to the start up command?
>
> script/server --debugger

This is the command correct ...!!!

Vladimir Rybas

unread,
Apr 7, 2009, 1:46:03 AM4/7/09
to Ruby on Rails: Talk
$ rdebug ./script/server would help
(Have to enter "c" after starting)

On Apr 7, 11:00 am, Daniel Tinivella <rails-mailing-l...@andreas-
Reply all
Reply to author
Forward
0 new messages