Now that you’ve gotten everything ready, it’s time to write your first program! Open your text editor, and type the following:
puts 1+2 |
Save your program (yep, that’s a complete program!) as calc.rb. Now run your program by typing ruby calc.rb into your command line. It should put a 3 on your screen. See, programming isn’t so hard, now is it?
18.219.4.174