Ruby in 20 mins lesson inconsistent?

Hi guys, I'm learning ruby and trying out the exercise from 

https://www.ruby-lang.org/en/documentation/quickstart/2/

I encountered a problem. 

irb(main):015:0> def h(name)irb(main):016:1> puts "Hello #{name}!"irb(main):017:1> end=> :hDoing this gets me inconsistent results. Sometimes after the third line 'end', i do not get a => :h back, meaning ruby didn't register what i wrote earlier. I checked each time to ensure the first 2 lines I input is the exact same with no character incorrect but I get different results some of the time. 

Anyone knows what's going on? 🙁 ((
What happens if you type something like

Code:
h('test')
What happens if you type something like

h('test')
I get:

irb(main):001:0> h<'test')SyntaxError: (irb):1: syntax error, unexpected ')', expecting end-of-input from D:/Program Files/Ruby22-x64/bin/irb:11:in `<main>'irb(main):002:0>Totally ignoring this lesson and learning from codeacademy instead.
You're likely doing something wrong (see the previous post < isn't ), is it?). You won't get a better answer since you've posted a working irb log. Post a complete one that shows your inconsistent or incorrect results.


Also note that in all RGSS versions def-expressions always return nil. RGSS3 uses Ruby 1.9.2p0 and returning the method name as symbol is a Ruby 2.1 feature.

Original thread: https://forums.rpgmakerweb.com/threads/ruby-in-20-mins-lesson-inconsistent.44174/