1. Computing

Using the Command Line

By

4 of 10

Save a Test Script

Now that you know how to navigate to your Ruby scripts, it's time to run them. Open your text editor and save the following program as test.rb.

#!/usr/bin/env ruby

print "What is your name? "
name = gets.chomp
puts "Hello #{name}!"

©2014 About.com. All rights reserved.