When you do GUI programming you move away from a sequentially
programming model to an event-driven model.

  a = gets

In the basic form, and making a few assumptions, this reads a line
from STDIN. It is a blocking method call--after the actual line will
be returned.

  entry = TkEntry.new(root).pack

This just creates a new Tk widget (in this case, a place to enter some
text) and returns immediately (it is also packed in the layout).  To
get the value of the user input later on you  likely want to setup an
event. (see: http://members.chello.nl/k.vangelder/ruby/learntk/events.html)

I would start learning Ruby/Tk by following the "Course" at:
http://members.chello.nl/k.vangelder/ruby/learntk/