Executing Ruby File from Terminal

We will be creating a ruby file in VSCode with the name ‘SimpleExample.rb’.

SimpleExample.rb:

print "Hello Ninjas! Please look forward to learn more.\n"
print "I hope you're enjoying it!\n"

You can also try this code with Online Ruby Compiler

Run Code

We will now execute the ruby file from the terminal using the command “ruby <filename>”.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *