Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3355340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:23:02+00:00 2026-05-18T02:23:02+00:00

I run Ubuntu 10.10. I just want to debug a simple script. After spending

  • 0

I run Ubuntu 10.10. I just want to debug a simple script. After spending half a day trying to figure out how that could be done I give up. What the heck am I supposed to do?

I installed ruby-dev from the Ubuntu repository
I ran sudo gem install ruby-debug and sudo gem install ruby-debug-ide

I tried a few different ways to make this work. I tried require 'ruby-debug' and then setting debugger somewhere in the code. But Ruby won’t find ruby-debug.
I tried setting up vim-ruby-debugger, which will take ages to execute :Rdebugger myScript.rb and will allow me to set breakpoints, but there doesn’t seem to be a way to execute my code using that debugger.
And I tried to use NetBeans which simply crashed every time I set up the project and clicked anything.

So, dear community: There must be a way to debug Ruby. Not Rails. Nothing fancy. Just some CLI script. Please help me or I lose what is left of my sanity.

Edit:
the gem exec dir was not in my path. So, at least rdebug seems to work now.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:23:03+00:00Added an answer on May 18, 2026 at 2:23 am

    Ruby-debug is for 1.8+ and ruby-debug19 is for 1.9+.

    ruby-debug is easy to learn and very useful. You can tell the application to run until a certain condition exists, then have it break, making it easy to locate nil values, or other conditions that occur sporadically.

    From the command-line use rdebug appname and you’ll end up at the debugger prompt. If you want to run to line 100 and stop you can enter c 100 and the debugger will set a temporary break-point, the program will run then stop there if it’s in the execution path. Once it stops the temporary break-point will be cleared. If you always want to stop at line 100 you could do b 100 then c and the debugger will set a permanent break-point, continue, then stop when the break-point is reached. You can clear the breakpoints, set conditional ones that occur when certain conditions apply, etc. You can type n to step to the next instruction skipping over subroutine calls, or s to step into them. There are commands to display contents of variables in various ways, so read through the docs.

    From inside rdebug you can drop into an IRB shell with your variables already populated so you can poke at things to see what happens. From inside either you can inspect or set values, helping with what-if adjustments. If you do that from within rdebug you can continue the program with the altered value(s) and see how it behaves.

    IRB has its place, and it’s great for trying things, but it’s not a substitute for the debugger, just as the debugger can do some IRB-ish things, but won’t replace it. Both tools are a good combination and beat the heck out of relying on print statements or dumping to a log file.


    Pry has emerged as a great combination of IRB and a debugger, and is well worth investigating.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just completed a fresh install of Ubuntu 10.10 and I'm trying to run
I have Ubuntu 11.10, and I have always run python just fine. However I
I run an installation of Ubuntu as a server. I have noticed that it
I run PHP 5.2 on Ubuntu with Apache 2. When I want to serve
I'm trying to run my php App from Ubuntu Server 11.10. This App works
I'm setting up a new Ubuntu server running nginx, and I'm trying to run
I have just created an Ubuntu virtual machine for web development and I want
I'm setting up Hadoop (0.20.2). For starters, I just want it to run on
I run a script which generated about 10k files in a directory. I just
I have a project in python that I am trying to run from IDLE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.