1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Using the Command Line


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.