Hello, World
Hello World Example in Ruby
Here is a simple "Hello, World!" program written in Ruby:
# hello.rb
puts 'Hello, World!'
Instructions to Run the Ruby Program
Save the Code: Save the above code in a file named
hello.rb
.Run the Program: Use the Ruby interpreter to run the program. Open a terminal and navigate to the directory containing
hello.rb
. Run the following command:ruby hello.rbYou should see the output:
Hello, World!
Summary
Save the code in
hello.rb
.Run with
ruby hello.rb
.
Last modified: 01 January 2025