本文系轉(zhuǎn)載
原文:http://yinghuayuan8866.blog.163.com/blog/static/2245702720122909571/
作者:寒秋雪狼——生活很美
RVM(Ruby Version Manager): is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
用于幫你安裝Ruby環(huán)境,幫你管理多個(gè)Ruby環(huán)境,幫你管理你開(kāi)發(fā)的每個(gè)Ruby應(yīng)用使用機(jī)器上哪個(gè)Ruby環(huán)境。Ruby環(huán)境不僅僅是Ruby本身,還包括依賴(lài)的第三方Ruby插件。都由RVM管理。
保證了兩個(gè)一致性:1.開(kāi)發(fā)、測(cè)試、生產(chǎn)環(huán)境的基礎(chǔ)Ruby環(huán)境一致。2.各個(gè)版本的Ruby都有與其完全匹配的第三方插件。
gems:At its most basic form, a Ruby gem is a package. It contains the necessary files and information for being installed on the system. Quoting RubyGems, ?a gem is a packaged Ruby application or library. It has a name (e.g. rake) and a version (e.g. 0.4.16)?.
可以叫做組件、庫(kù)或包,里面包含了該組件運(yùn)行所必需的各種文件和信息。當(dāng)你用該第三方組件,你知道它是可靠的,因?yàn)樗们逦慕Y(jié)構(gòu)自我描述,。
RubyGems: It is a package manager which became part of the standard library in Ruby 1.9. It allows developers to search, install and build gems, among other features. All of this is done by using the gemcommand-line utility. You can find its website at rubygems.org.
gems定義了包的結(jié)構(gòu),RubyGems是個(gè)工具,幫你管理單個(gè)包,包括搜索、安裝、創(chuàng)建一個(gè)gems。他和RVM的區(qū)別在于:RVM維護(hù)一組gems,仿佛是一個(gè)基線(xiàn),讓這一組gems是彼此匹配的,而RubyGems幫你維護(hù)一個(gè)gmes。
bundle:We designed bundler to make it easy to share your code across a number of development, staging and production machines. Of course, you know how to share your own application or gem: stick it on GitHub and clone it where you need it. Bundler makes it easy to make sure that your application has the dependencies it needs to start up and run without errors.
bundle 相當(dāng)于多個(gè)RubyGems批處理運(yùn)行。在配置文件gemfilel里說(shuō)明你的應(yīng)用依賴(lài)哪些第三方包,他自動(dòng)幫你下載安裝多個(gè)包,并且會(huì)下載這些包依賴(lài)的包。
gemfile:定義你的應(yīng)用依賴(lài)哪些第三方包,bundle根據(jù)該配置去尋找這些包。
git:Git is an extremely fast, efficient, distributed version control system ideal for the collaborative development of software.分布式版本控制/軟件配置管理軟件。
github:GitHub is the best way to collaborate with others. Fork, send pull requests and manage all your public and private git repositories.
是git的一個(gè)在線(xiàn)的代碼倉(cāng)庫(kù),網(wǎng)址github.com。
Rakefile: In a gem’s context, the Rakefile is extremely useful. It can hold various tasks to help building, testing and debugging your gem, among all other things that you might find useful.
Rake:Rake包括了Rakefile,用于創(chuàng)建和執(zhí)行某些任務(wù)。比如執(zhí)行測(cè)試,比如創(chuàng)建 一個(gè)修改數(shù)據(jù)庫(kù)的批處理任務(wù)。
將以上概念連接起來(lái):
1.安裝RVM :bash < <(curl -s )
2.用RVM安裝出一個(gè)或多個(gè)Ruby環(huán)境:$ rvm install 1.9.2
聯(lián)系客服