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 Foundations Ruby Core Symbols

K Jo
K Jo
7,283 Points

IRB?

On the Ruby on Rails track, I'm confused with why we sometimes launch Ruby programs from the command line using IRB and other times we access them without using IRB (i.e. simply typing...Ruby example.rb in the command line). It looks like IRB is is an interactive shell that allows us to play with code in real time. However, it seems like this is more cumbersome than just running the file without IRB (since you have to type irb just to open it, then load the file, etc.). It just seems like more steps than simply running the program directly.

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Generally speaking, when you simply just wanna run the ruby program and see its output, you will want to do ruby code.rb; but if you want to do more than just run the program, might you wanna play around or examine the codes, you'll wanna load that file into irb

K Jo
K Jo
7,283 Points

Okay, thanks for the quick reply