Saturday, 27 October 2012

How to Run Ruby on Mac?

1.First install Ruby on Mac

Actually Ruby-1.8.7 is preinstalled on Mac OS X, so you no need to install.

Just run $ruby -v in your mac Terminal to check your ruby version:



2.Edit your ruby program file

You can use Textwrangler to edit, save your program file with .rb postfix
For example you create a file rubytest.rb under directory Document.
Inside rubytest.rb only include one line

puts "My first ruby program."

Then on your Terminal, you can run

$ruby Document/rubytest.rb



That's it, very simple.


No comments:

Post a Comment