6.3. Ruby environment

发布时间 : 2023-10-23 23:00:07 UTC      

Page Views: Stats unavailable

6.3.1. Local environment settings #

If you want to set up the environment for the Ruby programming language, please read this chapter. This chapter introduces you to all the important topics related to environment settings. It is recommended that you learn thefollowing topics before delving into other topics:

  • Ruby installation on Linux/Unix: if you want to configure the development environment on Linux/Unix, review this section.

  • Ruby installation on Windows: if you want to configure the development environment on Windows, review 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 environmentvariables and sets them to make the Ruby interpreter work.

6.3.2. Popular Ruby editor #

To write a Ruby program, 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 can now be used 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.

6.3.3. Interactive Ruby (IRb) #

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

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

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

You don’t have to worry about the execution of the above command here, which we will explain to you in the following chapters.

6.3.4. What will you learn next? #

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

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.