Syntax

Ruby Print Output Syntax

In Ruby, print output: prints a line — puts "Hello"

Quick Answer

Syntax
puts "Hello"
RubySyntax

Print Output

Code example
puts "Hello"

Prints a line.

Learn More

How to print output in Ruby

  1. Open your Ruby file or editor.
  2. Copy the example, then replace its sample names and values for your code.

Ruby Print Output Syntax

Use puts "Hello".

Related Syntax References

Frequently asked questions

What is the Ruby syntax for print output?

Use this pattern: puts "Hello"

Can I copy this Ruby code example?

Yes. Use Copy code and adapt the example to your program.

Is this Ruby syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify