1

As I have a beginner level in Ruby, I'd like to be able to run my programs step by step to understand better what it does and be better able to debug what I type wrong. Like with VBA for instance, where you can add "watch" to some variables and see at each step what your instructions do VS what you expect to see.

EDIT : would a debugger work on cloud9 ?

harvey
  • 299
  • 1
  • 8

3 Answers3

0

You might want to use JetBrains RubyMine, a Ruby IDE.

Or you could get started with using a REPL like Pry with pry-debugger.

sealocal
  • 10,897
  • 3
  • 37
  • 50
  • Pry isn't a debugger, it's like IRB, an interactive Ruby shell. There is a debugging gem that works with Pry to let it behave like a debugger. See https://github.com/nixme/pry-debugger for Ruby < 2.0 or https://github.com/deivid-rodriguez/pry-byebug for 2.0+. – the Tin Man Nov 25 '14 at 07:13
0

Yes. It sounds like you're looking for a step debugger like 'ruby-debug'

Please see this post: How do I debug Ruby scripts?

Another useful post (external): http://pivotallabs.com/ruby-debug-in-30-seconds-we-don-t-need-no-stinkin-gui/

Community
  • 1
  • 1
Matt Pinkston
  • 1,610
  • 15
  • 18
0

For Ruby 2.0+, use byebug.

For Ruby < 2.0 use debugger or Ruby-debug.

You can also use the pry-debugger gem to tell Ruby to drop into Pry from a running script.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303