Just call: ruby your_program.rb
ruby your_program.rb
or
#!/usr/bin/env ruby
chmod +x your_program.rb
./your_program.rb some_param
Open your terminal and open folder where file is saved.Ex /home/User1/program/test.rb
/home/User1/program/test.rb
cd /home/User1/program
ruby test.rb
format or test.rb
class Test def initialize puts "I love India" endend# initialize objectTest.new
output
I love India
Assuming ruby interpreter is in your PATH (it should be), you simply run
ruby your_file.rb