Which one is best for debugging (Pry or Ruby Debug) ?

219 views
Skip to first unread message

Fahim Patel

unread,
Oct 12, 2012, 6:22:26 AM10/12/12
to rubyonra...@googlegroups.com
Hi all

I study and understand both the gem , now i am confuse which is one best.

Let me know which one is best for debugging ? 
Is either Pry or Ruby Debug  ?
Also explain advantage of your selected gem  ?


Thanks 

Regards 
Fahim Babar Patel

Norbert Melzer

unread,
Oct 12, 2012, 9:48:06 AM10/12/12
to rubyonra...@googlegroups.com

As far as I understood the differences ruby debug just sends you to irb, while pry sends you to the pry console which has syntax highlight, code completion and other sugar. But I am not aware of the differences in how to use them because I use neither.

Also as far as I know ruby debug doesn't work with ruby 1.9, bit pry does.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/T68z8J2ZCwcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Fahim Patel

unread,
Oct 12, 2012, 11:12:55 AM10/12/12
to rubyonra...@googlegroups.com

Thanks for reply.

Still can u tell me which one is best for debuging....

Bye

Jordon Bedwell

unread,
Oct 12, 2012, 11:18:48 AM10/12/12
to rubyonra...@googlegroups.com
Hi,

On Fri, Oct 12, 2012 at 5:22 AM, Fahim Patel <paf...@gmail.com> wrote:
> Let me know which one is best for debugging ?

Pry is a cross-over REPL (IMO) that replaces IRB and not Ruby
Debugger. I say it's cross-over because it supports some of what Ruby
Debugger does with addons and sometimes even built and also supports
all of what IRB does with some enhancements such as tab completion,
code spacing and syntax highlighting as well as supporting an easy way
to tap into an object with an REPL easily. There are also other
things like the ability to show the source of a class, a method and
source around where you are (if you are in a method.)

> Is either Pry or Ruby Debug ?

It's too much to compare Pry to Ruby Debugger because nothing can
replace Ruby Debugger in some cases but if you were throw Pry against
IRB for pure Ruby code it's going to be Pry all the way IMNSHO.

Nothing beats throwing binding.pry in the middle of everything and
figuring out what's going on from a "live" server, such as times when
something is going wrong in a model or controller or a decorator I
will throw a binding.pry in there and visit the page and follow the
tracks all the way down the line until I run into that line that is
causing the problem and then test what fixes it, write a test and fix
the code with the edit command and go on about my day.

> Also explain advantage of your selected gem ?

That's something you have to figure out for yourself but I listed some above.

Fahim Patel

unread,
Oct 12, 2012, 11:33:05 AM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
As we use binding.pry , but we use same debugger in ruby debugger.
And as per my knowledge debugger do same thing as binding.pry.If not than explain ?  

Jordon Bedwell

unread,
Oct 12, 2012, 11:48:57 AM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
On Friday, 12 October 2012 10:33:05 UTC-5, Fahim Patel wrote:
As we use binding.pry , but we use same debugger in ruby debugger.
And as per my knowledge debugger do same thing as binding.pry.If not than explain ?  

They do.  But there is a distinction in that one's only goal is to debug, the other is a cross-over tool who is stuck between deciding on if it's a REPL or a debugger.  By nature it has debugging tools but by theory it's just a more advanced way to test concepts without needing to jump in and out of the terminal (unless you use VI or other) to test ideas.

Most at #pry will probably not deny that Pry is a Debugger just as they will most probably not deny that Pry is a REPL which makes it a tranny (I had to) cross-over tool.  I remember Banister working hard to bring more debugging tools into Pry but I haven't talked to him for a while so I don't know if that's still the case.

So to address your question, I prefer Pry 90% of the time, I test all my concept code in Pry before writing it so I can work out pieces of the idea and make sure they are as bug free as possible without full testing, I also use it to debug pieces of code.  So hopefully this explains what I mean.

Fahim Patel

unread,
Oct 12, 2012, 11:55:57 AM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
Thanks thanks lot for reply.....
i will use pry now.
But one question raised when  u used this lines, which as follows :-
1.   Pry is a REPL 
2.   cross-over tool

What this lines means.

Regards 
Fahim Babar Patel

Fahim Patel

unread,
Oct 12, 2012, 11:59:58 AM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
I read article about REPL, i understood.

But what your cross over tool lines says.....?

Jordon Bedwell

unread,
Oct 12, 2012, 12:01:42 PM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
On Friday, 12 October 2012 10:55:58 UTC-5, Fahim Patel wrote:
1.   Pry is a REPL 
2.   cross-over tool
What this lines means.

1.) Read-eval-print loop, 2.) Stolen from car marketing (though I have no idea if it originates there), basically a cross-over was a mix between an SUV/Minivan and a car.  In this case Pry is the cross-over it's a mix between an REPL and debugger.

Fahim Patel

unread,
Oct 12, 2012, 12:09:42 PM10/12/12
to rubyonra...@googlegroups.com, envy...@gmail.com
Did u have any knowledge related to any deployment tool.

Colin Law

unread,
Oct 12, 2012, 12:45:22 PM10/12/12
to rubyonra...@googlegroups.com
Jordan, thanks for all the info on pry, I have been contemplating
giving it a go and your posts have encouraged me to get on with it.

Colin

Manish Chakravarty

unread,
Oct 14, 2012, 4:06:17 AM10/14/12
to rubyonra...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages