Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Ruby Environment

Ruby Environment

Local Environment Setup

If you want to set up an environment for the Ruby programming language, read this chapter. This chapter will explain all the important topics related to environment setup. It is recommended to study the following topics first before going deeper into other topics:

Popular Ruby Editors

To write Ruby programs, you need an editor:

Interactive Ruby (IRb)

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

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

Simply type at the command prompt irb, and an interactive Ruby session will begin, 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>

Here you don't need to worry about what the above command does; we will explain it in later chapters.

What's Next?

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