Skip to content
Novus Examples
rb59 B

Ruby — Hello World

The classic hello-world in Ruby — a single puts — for testing highlighters, the Ruby interpreter, and parsers.

Preview — first 3 linesrb
# The classic first program, in Ruby.
puts "Hello, world!"

Specifications

Language
Ruby
Kind
hello-world
Lines
2
Encoding
UTF-8
Line Endings
LF

What is a .rb file?

Ruby (.rb) is a plain-text source file for the Ruby programming language — a dynamically typed, object-oriented scripting language known for expressive, readable syntax and blocks. Everything is an object, and it is widely used for web development (Rails), scripting, and automation.

How to use this file

Use an example .rb file to test syntax highlighters, the Ruby interpreter, linters and formatters (RuboCop), and parser or language-detection tooling.

Generated by generation/code_samples.py. Free for any use, no attribution required — license.