Easy Tutorial
❮ Ruby Web Services Ruby Database Access ❯

Ruby Environment

Local Environment Setup

If you want to set up the Ruby programming language environment, please read the content of this section. This chapter will explain all the important topics related to environment setup. It is recommended to learn the following topics first, and then delve 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 that need to be set for the Ruby interpreter to work.

Popular Ruby Editors

To write Ruby programs, you need an editor:

Interactive Ruby (IRb)

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

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

Simply type irb at the command prompt, and 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 content of the above commands for now; we will explain them in subsequent chapters.

What's Next?

Assuming you have now set up the Ruby environment and are ready to write your first Ruby program. The next chapter will explain how to write Ruby programs.

❮ Ruby Web Services Ruby Database Access ❯