Save-Point

Full Version: Problem With Ruby IRB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good day everybody,

I've just upgraded to a new computer and am setting everything up like I used to have it.

For the life of me I cannot find the answer I'm looking for.

Ruby has been reinstalled and I forget how to handle IRB errors without the window closing in a split second. Does anybody know how to make it where the Ruby IRB window stays open until I close it? I need to see my error backtrace.
(12-19-2021, 01:30 PM)Kain Nobel Wrote: [ -> ]Good day everybody,

I've just upgraded to a new computer and am setting everything up like I used to have it.

For the life of me I cannot find the answer I'm looking for.

Ruby has been reinstalled and I forget how to handle IRB errors without the window closing in a split second. Does anybody know how to make it where the Ruby IRB window stays open until I close it? I need to see my error backtrace.

Thinking Let me see...

One way is the hard way, to open the console window first and then type the whole path to your file. PC No IRB included here. Winking

Another one could be to type the following line of code:

Code:
irb -r ./filename.rb

Also you could add this to a begin rescue loop as well:

Code:
system("PAUSE")

or

gets

or

$stdin.gets

Happy with a sweat In theory it should pause it. I won't be responsible for any side effects. Tongue sticking out
Ah, thank you Kyonides!

Code:
begin
  # Load the source
  require 'fxruby'
  # Build the widget...

rescue Exception => e
  p(e.message)
  system("PAUSE")
end

Works great! Thanks!