6.3. Ruby environment

发布时间 : 2025-10-25 13:34:02 UTC      

Page Views: 10 views

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.

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。