Tk is the standard graphical user interface (GUI) for Ruby. It provides a cross-platform GUI for Ruby programs.

Example code:

require "tk"
TkRoot.new{ title "Hello World!" }
Tk.mainloop

The result:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/15193f90-4b7b-4f55-bfca-0667e25a0958/Untitled.png

Step by Step explanation:

require "tk"

Load the tk package.

TkRoot.new{ title "Hello World!" }

Define a widget with the title Hello World

Tk.mainloop

Start the main loop and display the widget.