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) Ruby Numbers Ruby Numbers

kabir k
PLUS
kabir k
Courses Plus Student 18,036 Points

Treehouse Console vs. IRB

Why do we have to go into the IRB from the Treehouse workspace's Console to work with Ruby?

Do we need to have both platforms to work with Ruby? And are there instances where we can work with only the IRB?

1 Answer

Samuel Webb
Samuel Webb
25,370 Points

The Treehouse console is literally the same thing as opening a terminal window on Mac/Linux. You aren't supposed to use languages like Ruby directly in it. You need to run an interpreter to understand the code you're writing. For Ruby, you can use IRB. It's a Ruby interpreter which makes it possible to test out and run Ruby code. You can't run Ruby code in the console without using IRB, same as not being able to use Java without using java-repl, or python without ... well python3(is the command). All of these commands provide an interface within the console to be able to use the programming language of your choice. These are mainly used for testing out different pieces of code and logic.