Ruby environment


Local environment settings

If you want to set up an environment for the Ruby programming language, please read this chapter. This chapter will explain to you all the important topics related to environment settings. It is recommended to study the following topics first, and then further in-depth study of other topics:

  • Ruby installation on Linux / Unix: If you want to configure the development environment on Linux / Unix, please check the content of this chapter.

  • Ruby installation on Windows: If you want to configure the development environment on Windows, please check this chapter.

  • 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 a list of all important environment variables. Set these environment variables to make the Ruby interpreter work.

Popular Ruby editor

In order to write Ruby programs, you need an editor:

  • If you are writing on Windows, you can use any simple text editor, such as Notepad or Edit plus.

  • VIM (Vi IMproved) is a simple text editor that is available on almost all Unix and is now also 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. In the IRb shell, you can immediately view the interpretation result line by line.

This tool will be automatically included with Ruby installation, so you don't need to do other extra things, IRb can work normally.

Just type irb at the command prompt and an interactive Ruby Session will start, as shown below:

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


Here you don't need to care about the execution of the above command first, we will explain it to you in the subsequent chapters.

Subscribe For Daily Updates