Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Basics (Retired) How Ruby Works Input and Output

Terminal is freezing when running ruby hello.rb

when running command ruby hello.rb nothing happens, this is my code

name = gets
puts "Hello #{name}"

i am running ruby 1.9 should i be running 2.0 like jason is?

2 Answers

Ethan Lowry
PLUS
Ethan Lowry
Courses Plus Student 7,323 Points

Your code appears valid (you have those on 2 separate lines in the real thing, right?).

If you just type ruby -v in your terminal, do you get your ruby version number back successfully?

How about typing irb - does that successfully open a ruby console where you can try out these commands?

Just trying to establish if your environment is set up and working correctly.

rowend rowend
rowend rowend
2,926 Points

Maybe the console is waiting for user input....