debugger problems

Hi, I'm trying to debug my web application using the 'debugger' method,
unfortunately I get an error that the debugger method could not be
found. I have installed ruby-debu and started it with 'ruby
script/server --debugger',
I can see that the debug is enabled, but when I use the debugger let say
in the
controller, and run the application, it hits an error. using e.g.
<%= (debug @something) %> works.

Any idees ?. Thank you in advance

Hi Dani,

You got to be more explicit about the error that you’re getting.

David
http://dchua.com

Hi Dani,

You got to be more explicit about the error that you're getting.

And show the code where the error occurs

Colin

Wow, thank you for your quick response.

I'll provide the exact error message and an excerpt of the code where
the 'debugger' has been integrated.

I'll do it today evening.
Dani

Wow, thank you for your quick response.

I'll provide the exact error message and an excerpt of the code where
the 'debugger' has been integrated.

Include the full trace dump also, assuming there is one.

By the way it is best not to snip all the message to which you are
replying so that each message makes some sense in case the threading
gets broken.

Colin

Hi again,
so here is the excerpt of the code:
class StoreController < ApplicationController
  def index
    @products = Product.find_products_for_sale
  end
  def add_to_cart
    debugger <-------------------------------
    product = Product.find(params[:id])
    @cart = find_cart
    @cart.add_product(product)
  rescue ActiveRecord::RecordNotFound
    logger.error("Attempt to access invalid product #{params[:id]}")
    flash[:notice] = "Invalid Product"
    redirect_to :action => 'index'
  end

Here I start the server:

What do you see if you do
gem list
in the console. You should see ruby-debug and ruby-debug-base there.

Are you using radrails? Googling for the error message gave a
radrails issue as a possible cause.

Colin

What do you see if you do
gem list
in the console. You should see ruby-debug and ruby-debug-base there.

Are you using radrails? Googling for the error message gave a
radrails issue as a possible cause.

Colin

Hi Colin,
This is what I get (gem list):
actionmailer (2.3.5, 2.0.2)
actionpack (2.3.5, 2.0.2)
activerecord (2.3.5, 2.0.2)
activeresource (2.3.5, 2.0.2)
activesupport (2.3.5, 2.0.2)
capistrano (2.1.0)
cgi_multipart_eof_fix (2.5.0)
cmdparse (2.0.2)
columnize (0.3.1)
fxri (0.3.6)
fxruby (1.6.12)
gem_plugin (0.2.3)
highline (1.4.0)
hpricot (0.6)
linecache (0.43)
log4r (1.0.5)
mongrel (1.1.2)
mysql (2.7.3)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rack (1.0.1)
rails (2.3.5, 2.0.2)
rake (0.8.7, 0.8.1, 0.8.0, 0.7.3)
ruby-debug-base (0.10.3) <--------------------------------
ruby-debug-ide (0.4.6) <--------------------------------
rubygems-update (1.3.6, 1.0.1)
sources (0.0.1)
sqlite3-ruby (1.2.1)
win32-api (1.0.4)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.6)
win32-file (0.5.4)
win32-file-stat (1.2.7)
win32-process (0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.0)
windows-pr (0.7.2)

I have Aptana installed (radrails ?).
Dani

Well you are beyond my knowledge base here. The majority of Rails
users are on macs or linux, notably Ubuntu, which includes me.

http://rubyforge.org/tracker/index.php?func=detail&aid=26656&group_id=1900&atid=7436
includes the comment fixed in ruby-debug-ide 0.4.8
How you go about getting the later version I do not know.

On Ubuntu I do not have ruby-debug-ide but have ruby-debug instead

Any Aptana experts out there?

If you don't get any help here it might be worth starting a new thread
with the error and Aptana in the subject.

Alternatively try Ubuntu, it is great. You can set up a dual boot on
the PC so you can still use windows, which is what I did and now I
hardly use windows at all. Suddenly I feel that I am back in control
of the PC again.

Colin

Colin Law wrote:

Well you are beyond my knowledge base here. The majority of Rails
users are on macs or linux, notably Ubuntu, which includes me.

http://rubyforge.org/tracker/index.php?func=detail&aid=26656&group_id=1900&atid=7436
includes the comment fixed in ruby-debug-ide 0.4.8
How you go about getting the later version I do not know.

On Ubuntu I do not have ruby-debug-ide but have ruby-debug instead

Any Aptana experts out there?

If you don't get any help here it might be worth starting a new thread
with the error and Aptana in the subject.

Alternatively try Ubuntu, it is great. You can set up a dual boot on
the PC so you can still use windows, which is what I did and now I
hardly use windows at all. Suddenly I feel that I am back in control
of the PC again.

Colin

Ok, thank you very much colin for taking time to look at my issue.
I'm not so familiar with linux, but I assume I have to start looking at
it.
Thank you,
Dani

Colin Law wrote:

Alternatively try Ubuntu, it is great. You can set up a dual boot on
the PC so you can still use windows

+1
Or even easier; run a virtual machine (VMWare or Virtual Box) inside
Windows to experiment with.

I'm not so familiar with linux, but I assume I have to start looking at it.

After using Windows when I started with Rails, I moved to Linux just
over a year ago, and haven't looked back. It's extraordinarily easy to
get running with, and you can just pretend it's Windows for a while
and stick to the GUI while you get comfortable dipping in and out of
terminal windows.

Make the leap :slight_smile:

If you do decide to try Ubuntu there is a good getting started guide
at http://www.ubuntupocketguide.com/index_main.html and join the
ubuntu users mailing list which is very helpful for beginners and
experienced alike,
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users.

Colin

Thank you all for your support. Yes, I'll try Linux.

Regards,

Dani

Dani Dani wrote:

Thank you all for your support. Yes, I'll try Linux.

Regards,

Dani

Well, I am using Debian (upstream of Ubuntu) and I am getting exactly
the same error. I do have Aptana RadRails installed, but I am using it
only as an editor. I run the app from the app-root directory with
script/server --debugger, and it runs until I hit the debugger statement
then it crashes with the "undefined method `run_init_script' for
Debugger:Module" error.

I'll keep you posted if I figure out a fix.

Don Ziesig

What does gem list show? It should have ruby-debug and
ruby-debug-base but not ruby-debug-ide which is apparently the
radrails one that can cause the problem.

Colin

Colin Law wrote:

Ivan Maltz wrote:

I had the same problem. I ran 'gem install ruby-debug' and now all is
good.

Hi, may I ask, are you using linux or windows operating system ?. I'm
using windows and did the same ('gem install ruby-debug'), still same
issue as mentioned above.
If you type 'gem list', do you get:
ruby-debug-base and ruby-debug-ide listed, or
ruby-debug-base and ruby-debug ?
Thanks, dani

Dani Dani wrote:

Hi, may I ask, are you using linux or windows operating system ?. I'm
using windows and did the same ('gem install ruby-debug'), still same
issue as mentioned above.

I'm using Windows 7

If you type 'gem list', do you get:
ruby-debug-base and ruby-debug-ide listed, or
ruby-debug-base and ruby-debug ?

Originally, I had:
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.5)

Now, after running 'gem install ruby-debug' I get:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.5)

-Ivan

Ivan Maltz wrote:

I'm using Windows 7

If you type 'gem list', do you get:
ruby-debug-base and ruby-debug-ide listed, or
ruby-debug-base and ruby-debug ?

Originally, I had:
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.5)

Now, after running 'gem install ruby-debug' I get:
ruby-debug (0.10.3)
ruby-debug-base (0.10.3)
ruby-debug-ide (0.4.5)

-Ivan

I'm using xp prof. well, I'll try today evening again the
'gem install ruby-debug', even though I think I have done it already
(otherwise I would'nt have the ruby-debug-base and ruby-debug-ide.
Thank you,
Dani

If still no joy then you could try removing ruby-debug-ide as it is
not required for normal use of ruby-debug and it is the one giving the
problems I think. It is something to do with Aptana/radrails

Colin