I am a newbie, forgive if this is an obvious question but does anyone know why my irb repl isn't able to do multilines? I have tried lots of different if statements (copied from course notes that I am doing - but not copied and pasted just typed) and I get this traceback message every time.
Will be grateful for advice!
CodePudding user response:
I've just read in the notes that this is due to doing a return that isn't in a method. It might become clearer later on.
Also, just copying this answer that was added as a comment so other people see it. Removing the 'return' works:
"While there are reasons to use the return keyword in ruby, if you are just learning start out by never typing this word. Ruby will always return the last statement executed, so just rely on this fact for now and structure your programming around it."