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

32,041

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/

Share:
32,041

Related videos on Youtube

user487743
Author by

user487743

Updated on July 09, 2022

Comments

  • user487743
    user487743 almost 2 years

    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

    • FrustratedWithFormsDesigner
      FrustratedWithFormsDesigner about 13 years
      You probably have to run the file using the ruby interpreter. I think it would be something like ruby lab7.rb. The output would only show in a browser window if the script is going to be handled by a server process. Did you set up a server to serve Ruby pages?
    • Platinum Azure
      Platinum Azure about 13 years
      @FrustratedWithFormsDesigner: That's good material for an answer. :-)
    • Platinum Azure
      Platinum Azure about 13 years
      @FrustratedWithFormsDesigner: Put it down as an answer and I'll vote you up. :-)

Related