how to enable debugging on the server?

Wanting to run the script/server in debugger mode, my dialog looked like this:

ruby script/server --debugger
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install

OK, so I installed:

sudo gem install ruby-debug
Password:
Successfully installed ruby-debug-0.10.3
1 gem installed
Installing ri documentation for ruby-debug-0.10.3…
Installing RDoc documentation for ruby-debug-0.10.3…

Great, so I try again:

ruby script/server --debugger
=> Booting WEBrick
=> Rails 2.3.4 application starting on http://0.0.0.0:3000
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install

Hey wait, didn’t I just do that? Yes, I did!

So what gives? Anyone know what I need to do to enable debugging on the server?

Bryan Lockwood

At a guess you have two different installs of ruby and you've invoked
the ruby from one but the gem install from the other ( running which
ruby and which gem might shed some light).

Fred

To make it simple, I now have only one version of rails, and that is 2.3.4. So I uninstalled both ruby-debug and ruby-debug-base, then
re-installed them, with apparently unflawed success. I tried again to invoke the rails server with the --debugger option, only to receive
the same complaint back - namely, that I need to gem-install the ruby-debug gem. For yucks, I verified that the debugger itself still seems
to be working fine, thank you.

And so I'm stuck here. I"m convinced I'm going to have to drop down to the debugger at some point in my further explorations with rails,
and I wish like hell I knew how to do that.

Still seeking the answer. At this point, waiting for inspiration.

Bryan

To make it simple, I now have only one version of rails, and that is
2.3.4. So I uninstalled both ruby-debug and ruby-debug-base, then

What about versions of ruby ?

re-installed them, with apparently unflawed success. I tried again to
invoke the rails server with the --debugger option, only to receive
the same complaint back - namely, that I need to gem-install the ruby-
debug gem. For yucks, I verified that the debugger itself still seems
to be working fine, thank you.

debug and ruby-debug are different things

Fred

To make things simple, I now have only one version of rails, and that is 2.3.5. So I uninstalled both ruby-debug and ruby-debug-base, then
re-installed them, with apparently unflawed success. I tried again to invoke the rails server with the --debugger option, only to receive
the same complaint back - namely, that I need to gem-install the ruby-debug gem. For yucks, I verified that the debugger itself is still working
fine.

Here's my latest foray:

depot 503 ->gem list --local

*** LOCAL GEMS ***

...
rails (2.3.5)
rake (0.8.7)
rspec (1.2.9)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
sqlite3-ruby (1.2.5)
thin (1.2.5, 1.2.4)

depot 504 ->sudo gem uninstall ruby-debug ruby-debug-base
Password:
Remove executables:
  rdebug

in addition to the gem? [Yn] y
Removing rdebug
Successfully uninstalled ruby-debug-0.10.3
Successfully uninstalled ruby-debug-base-0.10.3

depot 505 ->sudo gem install ruby-debug
Building native extensions. This could take a while...
Successfully installed ruby-debug-base-0.10.3
Successfully installed ruby-debug-0.10.3
2 gems installed
Installing ri documentation for ruby-debug-base-0.10.3...
Installing ri documentation for ruby-debug-0.10.3...
Installing RDoc documentation for ruby-debug-base-0.10.3...
Installing RDoc documentation for ruby-debug-0.10.3...

depot 506 ->ruby script/server --debugger
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'

OK, I found the exception was caused by this line in /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/debugger.rb

         require_library_or_gem 'ruby-debug'

Printing the Exception this raises shows me:

dlopen(/usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle, 9): no suitable image found. Did find:
  /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle: mach-o, but wrong architecture - /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle

Invoking file on that file shows:

/usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle: Mach-O 64-bit bundle x86_64

And invoking arch shows me:

i386

OK, so it looks like this 64.bit bundle is spoiling the 32-bit show. Anyone have any ideas as to what the next step would be?

Regards,

Bryan

To make it simple, I now have only one version of rails, and that is
2.3.4. So I uninstalled both ruby-debug and ruby-debug-base, then

What about versions of ruby ?

depot 619 ->which ruby
/usr/local/bin/ruby

depot 620 ->ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0]

depot 621 ->ls /usr/bin/ruby
/usr/bin/ruby

depot 622 ->/usr/bin/ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

re-installed them, with apparently unflawed success. I tried again to
invoke the rails server with the --debugger option, only to receive
the same complaint back - namely, that I need to gem-install the ruby-
debug gem. For yucks, I verified that the debugger itself still seems
to be working fine, thank you.

debug and ruby-debug are different things

OK, I guess that makes sense.

I think the IMPORTANT NEW INFORMATION is this:

I found the exception was caused by this line in /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/debugger.rb

        require_library_or_gem 'ruby-debug'

Printing the Exception this raises shows me:

dlopen(/usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle, 9): no suitable image found. Did find:
  /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle: mach-o, but wrong architecture - /usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle

Invoking 'file' on that file shows:

/usr/local/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.3/lib/ruby_debug.bundle: Mach-O 64-bit bundle x86_64

And invoking arch shows me:

i386

OK, so it looks like this 64.bit bundle is spoiling the 32-bit show. Anyone have any ideas as to what the next step would be?

Bryan

arch on my machine also reports i386 even though I have 64 bit ruby
etc. What you really care about is what lipo -detailed_info /path/to/
ruby says

Fred