How can I clear the terminal in Ruby?

If you want something that is vaguely portable you can try:

system "clear" || system "cls"

which will try both clear and cls

Leave a Comment