Return Output missing from IRG

Hi, Im very new to ruby and have just started following a book on the language. When i use the command IRB I get the Main prompt up but if I type in something like

$ Puts “Ruby is Awesome”

Instead of getting a return output it goes to the next line. Each time I type something in the IRB the line number increases so my prompt looks like so.
irb(main):001:0> puts :ruby is awsome"
irb(main):002:0" puts “ruby is awsome”
irb(main):003:0" 2+2
irb(main):004:0" Puts “Ruby is Awesome”

With no outputs at all. Any ideas how or why this might be happening?.

Thanks Keiffy101

What OS are you using? What version of Ruby? (You can find out by typing ruby -v at the command prompt.) Does this happen every time?

This won’t work as typed. The colon needs to be a double quote. This is also the reason you’re not seeing any output. Try opening a new terminal and typing this:

puts "ruby is awesome"
1 Like

Hi scannon thanks for the reply, I obviously didn’t do much checking to see where I could have gone wrong. I opened up IRB again and typed

puts “ruby is awesome"

and got the result i was expecting from the tutorial. I guess because i got the first line of the code wrong it continued to not output anything, I can’t think back to if i tried a fresh opened IRB console earlier today but i guess if i had i wouldn’t have to have asked such a silly question. Thanks for the help.

Notice how the first line has the “>” prompt while the others don’t.

If you can get in the habit of noticing when it’s not there it should be of some help for you in the future

1 Like

Thanks Mittineague, I thought after looking at it again last night that > might have something to do with it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.