6.46. Ruby RubyGems

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

Page Views: 10 views

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

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

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