how to use rails debug ?

I wish to debugging my app.I install gem and start my console by using --debug option .

But i don’t know how to use it.

Give me some helpful starting for core .

I search and get some good pages, but when i fire commands ,not working.

How trace methods ?

How to trace variable ?



Fahim Babar Patel

You should use “pry” gem. It is much easier.


1.Is pry is best for debugging in your experience .

2 .Can it work same as we work on console ? or we have to learn some new command ?

  1. Can we debug our controller and model methods line by line ?

I know i have lots of questions ?

Just give me one line answer which i can understood.


The answer of first and third question is yes.
It also works on console. No new tool or commands needed to be learned.

i have one more problem can u solve this…

This question is related to cucumber and capybara.

I am handling three form in one page . It means i am handling three model. this three are connected to each other using association.

I am using nested form concept.

In development stage working perfectly.

When i write feature file to test , i dont know how to fill my inner forms text field.

I will explain u .

Assume three model a,b,c.

a[b][c][0][attibutes] # name generated by rail is this

when i write this step in file

fill_in “a[b][c][0][attibutes]” , :with=>testing

i get error

cannot fill in, no text field, text area or password field with id, name, or label a[b][c][0][attibutes]

Hope u all understood problem

I am not able to help you in integration testing as I have never done it. Anybody please help him.