How to execute a Ruby script in Terminal?

I’ve set everything up that I need on my Mac (Ruby, Rails, Homebrew, Git, etc), and I’ve even written a small program. Now, how do I execute it in Terminal? I wrote the program in Redcar and saved it as a .rb, but I don’t know how to execute it through Terminal. I want to run the program and see if it actually works. How do I do this?

9 Answers
9

Leave a Comment