ruby2.0 (Rails) Later versions of debug

Source: Internet
Author: User

Very like Ruby (RAILS), know also for a long time, but to tell the truth, never useless ror write anything, is a little bit, do something to entertain yourself, encounter what problems, basic careful look, plus a few log to find the reason, never thought to debug

When it comes to debug, it's impossible to say that Visual Studio, debug is easy to die! Ruby in the language comfort on the C#10 Street, C # in debugging on the RUBY10 strip street ...

Unknowingly, Ruby has already entered the 2.0 era, and now find a bit online, basic about the debug of Ruby, is for Ruby 1.8 or 1.9 of, about 2.0 is not much, I also looked for a long time, accidentally found debugger this Ruby debugger, see the home page written

A Fork of Ruby-debug () that works on 1.9.2 and 1.9.3 and installs easily for rvm/rbenv rubies. Ruby >= 2.0 is not supported

Really dead heart all have, fortunately in the last write a sentence, 2.0 to this

Https://github.com/deivid-rodriguez/byebug

This is it, this is my first time with the character interface debug Ah, the second time to die Heart has been ... Anyway, at least you can use it.

It is not difficult to use, after installing the gem, in the need to place a breakpoint, plus a sentence byebug on the line, the program will be there broken down, and the source code displayed in the character interface, input variables can see the value

It's not much of a use, record a few common commands.

L Display the source code under the breakpoint

s shows which step is currently in

V display value, there are many subcommands, like V L is to display local variables in the current context, V g is a global variable, look at the help to know

D Next

Useless to too many features, specific help here

Https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md

Anyway, it is not used to ah, someone else node. JS is also a character interface, at least there is a browser extension, you can debug on the browser, it is also clear, quite easy to use, do not know when Ruby can have a good debugger

ruby2.0 (Rails) Later versions of debug

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.