Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view a .rb (Ruby) file?

Tags:

ruby

So we just learned Ruby in class today, and we are just starting to write our own scripts. So I just wrote a very simple "Hello World" app in Ruby. I saved the file as lab7.rb . So now my question is how do I view the output of the file? Do I open it in a browser? Thanks

like image 289
user487743 Avatar asked Apr 06 '11 18:04

user487743


1 Answers

You have to install the ruby interpreter in your machine.

If you're running in Linux or MacOS you probably have it already, try typing:

ruby lab7.rb

In windows download it here:

http://www.ruby-lang.org/en/downloads/

like image 88
OscarRyz Avatar answered Sep 21 '22 03:09

OscarRyz