Save-Point
Problem With Ruby IRB - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Official Area (https://www.save-point.org/forum-3.html)
+--- Forum: Tech Talk (https://www.save-point.org/forum-87.html)
+--- Thread: Problem With Ruby IRB (/thread-8425.html)



Problem With Ruby IRB - Kain Nobel - 12-19-2021

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.


RE: Problem With Ruby IRB - kyonides - 12-19-2021

(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


RE: Problem With Ruby IRB - Kain Nobel - 12-20-2021

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!