6.46. Ruby RubyGems

发布时间 :2023-11-03 23:00:06 UTC      

RubyGems is a package manager for Ruby that provides a standard format for distributing Ruby programs and libraries, as well as a tool for managing package installations.

RubyGems is designed to easily manage gem the tools that are installed,and for distribution gem the server. This is similar to apt-get under Ubuntu, Centos yum , Python’s pip .

RubyGems was founded around November 2003 and has been part of the Ruby standard library since Ruby version 1.9.

If your Ruby is lower than version 1.9, you can also install it manually:

Update RubyGems command:

$ gem update --system          # Administrator or root user required

6.46.1. Gem #

Gem is the package manager for the Ruby module (called Gems). It contains package information, as well as files for installation.

Gem is usually built on the “.gemspec” file, which contains a YAML file with information about Gem. Ruby code can also build Gem directly, which is usually done using Rake.

6.46.2. Gem command #

gem commands are used to build, upload, download, and install Gem packages.

6.46.3. Gem usage #

RubyGems is functionally very similar to apt-get, portage, yum, and npm.

Installation:

gem install mygem

Uninstall:

gem uninstall mygem

List what has been installed gem :

gem list --local

List what is available gem , for example:

gem list --remote

For all gems create an RDoc document:

gem rdoc --all

Download one gem , but do not install:

gem fetch mygem

From the available gem search in, for example:

gem search STRING --remote

6.46.4. Construction of gem package #

gem commands are also used to build and maintain .gemspec and .gem files.

Utilization .gemspec file construction .gem :

gem build mygem.gemspec

6.46.5. Modify domestic sources #

Due to domestic network reasons (you know), the intermittent connection of the resource files stored in rubygems.org on Amazon S3 failed.

So you will meet with gem install rack or bundle install when there is no response for half a day, you can use the gem install rails -V to view the execution process.

So we can modify it to the domestic download source: https://gems.ruby-china.com

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.