If you want to do the for loop on one line, you have to throw in the do
for i in 1..5 do print i, " " end # => 1 2 3 4 5