|
RubyGems是一個方便而強(qiáng)大的Ruby程序包管理器( package manager),類似RedHat的RPM.它將一個Ruby應(yīng)用程序打包到一個gem里,作為一個安裝單元。
當(dāng)前最新版本為0.8.3 下載地址:http:///frs/?group_id=126 主頁:http://rubygems./wiki/wiki.pl 最新的Ruby版本已經(jīng)包含RubyGems了。 特點(diǎn): 能遠(yuǎn)程安裝包 包之間依賴關(guān)系的管理 簡單可靠的卸載(uninstallation) 查詢機(jī)制,能查詢本地和遠(yuǎn)程服務(wù)器的包信息 能保持一個包的不同版本 基于Web的查看接口,能查看你安裝的gem的信息。 安裝RubyGems 首先從rubyforge下載它的源文件 ,然后解壓縮到一個地方,比如C:rubygems-0.8.3
安裝其實(shí)很簡單。使用也簡單,不帶參數(shù)運(yùn)行g(shù)em則顯示使用方法: 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 如果命令沒有指明是從本地還是遠(yuǎn)程安裝,則默認(rèn)先從本地安裝,因?yàn)檎也坏絩ails*.gem文件,所以,所以再從遠(yuǎn)程安裝。 遇到Rails依賴的包,我們也需要安裝。 默認(rèn)得,這些gems都被安裝到了RUBY_HOMElibrubygems1.8gems下了(各個平臺,版本都可能不同) 你可以用--dir選項(xiàng)覆蓋這個默認(rèn)值。 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 中國標(biāo)準(zhǔn)時間] "GET / HTTP/1.1" 200 2248 |
|
|