RubyGems是一个方便而强大的Ruby程序包管理器( package manager),类似RedHat的RPM.它将一个Ruby应用程序打包到一个gem里,作为一个安装单元。
当前最新版本为0.8.3 下载地址:http:///frs/?group_id=126 主页:http://rubygems./wiki/wiki.pl 最新的Ruby版本已经包含RubyGems了。 特点: 能远程安装包 包之间依赖关系的管理 简单可靠的卸载(uninstallation) 查询机制,能查询本地和远程服务器的包信息 能保持一个包的不同版本 基于Web的查看接口,能查看你安装的gem的信息。 安装RubyGems 首先从rubyforge下载它的源文件 ,然后解压缩到一个地方,比如C:rubygems-0.8.3
安装其实很简单。使用也简单,不带参数运行gem则显示使用方法: C:rubygems-0.8.3>gem RubyGems is a sophisticated package manager for Ruby. This is a basic help message containing pointers to more information. Usage: gem -h/--help gem -v/--version gem command [arguments...] [options...] Examples: gem install rake gem list --local gem build package.gemspec gem help install Further help: gem help commands list all ‘gem‘ commands gem help examples show some examples of usage gem help (e.g. ‘gem help install‘) Further information: http://rubygems. 安装Rails C:rubygems-0.8.3>gem install rails Attempting local installation of ‘rails‘ Local gem file not found: rails*.gem Attempting remote installation of ‘rails‘ Install required dependency rake? [Yn] y Install required dependency activerecord? [Yn] y Install required dependency actionpack? [Yn] y Install required dependency actionmailer? [Yn] y Successfully installed rails, version 0.9.1 Installing RDoc documentation for rails-0.9.1... WARNING: Generating RDoc on .gem that may not have RDoc. lib/binding_of_caller.rb:4:25: Couldn‘t find Continuation. Assuming it‘s a mod e lib/binding_of_caller.rb:36:21: Couldn‘t find Binding. Assuming it‘s a module lib/rails_generator.rb:34:46: Skipping require of dynamic string: "#{path}/#{n e}_generator.rb" Installing RDoc documentation for rake-0.4.12... Installing RDoc documentation for activerecord-1.2.0... Installing RDoc documentation for actionpack-1.0.1... lib/action_controller/scaffolding.rb:87:37: Skipping require of dynamic string "#{model_id.id2name}" Installing RDoc documentation for actionmailer-0.5.0... C:rubygems-0.8.3>gem query --local *** LOCAL GEMS *** actionmailer (0.5.0) Service layer for easy email delivery and testing. actionpack (1.0.1) Web-flow and rendering framework putting the VC in MVC. activerecord (1.2.0) Implements the ActiveRecord pattern for ORM. rails (0.9.1) Web-application framework with template engine, control-flow layer, and ORM. rake (0.4.12) Ruby based make-like utility. sources (0.0.1) This package provides download sources for remote gem installation 如果命令没有指明是从本地还是远程安装,则默认先从本地安装,因为找不到rails*.gem文件,所以,所以再从远程安装。 遇到Rails依赖的包,我们也需要安装。 默认得,这些gems都被安装到了RUBY_HOMElibrubygems1.8gems下了(各个平台,版本都可能不同) 你可以用--dir选项覆盖这个默认值。 RubyGems还自带了一个基于 C:rubygems-0.8.3>gem_server [2004-12-19 13:06:12] INFO WEBrick 1.3.1 [2004-12-19 13:06:12] INFO ruby 1.8.2 (2004-11-06) [i386-mswin32] [2004-12-19 13:06:12] INFO WEBrick::HTTPServer#start: pid=624 port=8808 127.0.0.1 - - [19/Dec/2004:13:06:26 中国标准时间] "GET / HTTP/1.1" 200 2248 |
|