DEV Community

Cover image for Ruby-HelloWorld
LUCIANO DE SOUSA PEREIRA
LUCIANO DE SOUSA PEREIRA

Posted on • Originally published at github.com

1 1

Ruby-HelloWorld

titulo

First time coding with Ruby in a Windows 10 environment.

GitHub repository: Ruby-HelloWorld

Instructions

Download the latest version of Ruby with DevKit in this link.

print01

Keep the default configuration and install it.

print02

There is a second installation for Ruby components. Just press ENTER.

print03

To see if Ruby is correctly installed, open the terminal and run:

ruby --version

The result will be:

print04

Now you are ready to program in Ruby.

Create a file named hello_world.rb with the following code:

puts "Hello World!"

Run the file:

ruby .\hello_world.rb

The result will be:

print05

There are other ways to print messages. Add these lines to the file:

print "Hello World!"
p "Hello World!"

Run it again and the result will be:

print06

What happened?

puts writes the message in one line.

print writes the message without jumping to the next line.

p inspects the element.

References

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay