I've set everything up that i need on my mac (ruby, rails, homebrew, git, etc), and i've even written a small program. What's the best way to execute a program in a 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'm going to run the program and see if it's working How do i do this?

Best Answer

Just call: ruby your_program.rb


  • start your program with #!/usr/bin/env ruby ,
  • make your file executable by running chmod +x your_program.rb
  • and do ./your_program.rb some_param