Ruby Environment
Local Environment Setup
If you want to set up the environment for the Ruby programming language, please read this chapter. This chapter will explain all the important topics related to environment setup. It is recommended to learn the following topics first before diving deeper into other topics:
Ruby Installation on Linux/Unix: If you want to configure the development environment on Linux/Unix, please refer to this section.
Ruby Installation on Windows: If you want to configure the development environment on Windows, please refer to this section.
Ruby Command Line Options: This section lists all the command line options that you can use with the Ruby interpreter.
Ruby Environment Variables: This section lists all the important environment variables; set these environment variables to make the Ruby interpreter work.
Popular Ruby Editors
To write Ruby programs, you need an editor:
- If you are writing on Windows, you can use any simple text editor such as VSCode or Edit Plus.
- VIMVim (Vi IMproved) is a simple text editor available on almost all Unix systems, and it is now also available on Windows. In addition, you can also use your favorite vi editor to write Ruby programs.
- RubyWinis a Ruby integrated development environment (IDE) for Windows.
- Ruby Development Environment (RDE)For Windows users, it is also a good integrated development environment (IDE).
Interactive Ruby (IRb)
Interactive Ruby (IRb) provides a shell for experimentation. Within the IRb shell, you can immediately view the interpretation results line by line.
This tool comes automatically with the Ruby installation, so you don't need to do anything extra; IRb works just fine.
Just type the following in the command promptirb, an interactive Ruby session will start, as shown below:
$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>
You don't need to worry about the execution of the above command for now; we will explain it in later chapters.
What to Learn Next?
Assuming you have now set up your Ruby environment and are ready to write your first Ruby program, in the next chapter we will explain how to write Ruby programs.
Other Extensions