Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Ruby environment


May 12, 2021 Ruby


Table of contents


Ruby environment

Local environment settings

If you want to set up an environment for the Ruby programming language, read this section. T his chapter will show you all the important topics related to environment settings. It is recommended to learn the following topics before going any further into the other topics:

Popular Ruby editor

In order to write a Ruby program, you need an editor:

  • If you're writing on Windows, you can use any simple text editor, such as Notepad or Edit plus.
  • Vi IMproved is a simple text editor that is available on almost all Unix and is now available on Windows. In addition, you can use your favorite vi editor to write Ruby programs.
  • RubyWin is a Ruby Integrated Development Environment (IDE) for Windows.
  • Ruby Development Environment (RDE) is also a good integrated development environment (IDE) for Windows users.

Interactive Ruby (IRb)

Interactive Ruby (IRb) provides a shell for the experience. Within the IRb shell, you can view the results of the interpretation line by line immediately.

This tool comes automatically with Ruby's installation, so you don't need to do anything extra for IRb to work.

Just type irb in the command prompt, and an interactive Ruby Session will start, as follows:

$irb
irb 0.6.1(99/09/16)
irb(main):001:0> def hello
irb(main):002:1> out = "Hello World"
irb(main):003:1> puts out
irb(main):004:1> end
nil
irb(main):005:0> hello
Hello World
nil
irb(main):006:0>

Here you can first not care about the execution of the above commands, we will explain to you in a later section.

What will you learn next?

Let's say you've set up your Ruby environment now and are ready to write your first Ruby program. In the next chapter we'll show you how to write a Ruby program.