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 Hello World!

'clear' is not recognized as an internal or external command, operable program or batch file.

I have ruby installed
ruby -v returns ruby 2.3.1p112...
irb returns irb(main):...
puts "hello" returns hello => nil
exit brings back the prompt
Everything seems to be fine following 
along with the wideo
I have a document on my desktop hello.rb
in my editor, I type 
puts "Hello World"
outputs 
Hello World to the document
So I think I have things set up MOSTLY
but I'm missing something BECAUSE...
after typing exit (from irb)
when I type clear, I get this error
'clear' is not recognized as an internal or 
external command, operable program or batch file.

I'm working in my own console, with my own editor and a hello.rb document on my desktop.

I rebooted (which I hate to do cause win 10 something stupid always does, and tells me they're improving my experience) I was still getting the error. And then I looked again at your post. As many times as I saw cls as you had written, my mind was reading clr (abr for clear). Thanks, your post helped. It was when I read it for the 10nth time that I actually saw "short for clear screen" not "short for clear".

Andren, I just really want to thank you again for your help. I'm working through the course in my own environment now. Everything is cool (for the moment). I just don't feel like I'm really learning when I'm in workspaces.

1 Answer

andren
andren
28,558 Points

Assuming you are using the Windows command line (cmd) there doesn't seem to be anything wrong. Clear is the command used to clear the terminal on OSX and Linux systems. For cmd the corresponding command is cls, short for clear screen.

Do note though that there is a different more advanced command line application available on Windows called Powershell which supports most of the standard OSX/Linux style commands. Using that instead of the normal cmd might make it easier for you to follow the tutorials on this site.

To open Powershell just open the start menu and type Powershell and the first result should launch it on your machine.

Thank you so much Andren.

I'm thinking I need to install ruby for powershell somehow? Cause I opened powershell typed in ruby -v and it didn't recognize the command.

andren
andren
28,558 Points

Have you rebooted Windows since you installed ruby? Powershell should have access to the same programs that cmd does.