免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
rvm,gems,rubygems,bundle,gemfile,git,rake,怎么這么多概念,都是干什么用的?


 

本文系轉(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

3.用RVM指出現(xiàn)在使用哪個(gè)版本的Ruby環(huán)境:$ rvm use 1.9.2
4.用gem安裝rails $ gem install rails (gem是ruby的內(nèi)置的)
5.安裝后的rails,以一組gems的形式,存儲(chǔ)在RVM1.9.2的環(huán)境倉(cāng)庫(kù)里。 
6.用安裝的rails,生成你自己的應(yīng)用。 work> rails new demo
7.用rake,生成rails的API文檔, > rake doc:rails
8.在rails生成的應(yīng)用目錄下,寫(xiě)自己的代碼,用git進(jìn)行版本控制。
9.需要新功能,安裝新組件,在gemfile文件中添加需要的組件,并用bundle下載安裝多個(gè)組件及其依賴(lài)的其他組件,這些組件仍然存儲(chǔ)到RVM的gems庫(kù)里。
10.用rake執(zhí)行 生成、修改數(shù)據(jù)庫(kù),執(zhí)行測(cè)試等要多次執(zhí)行的任務(wù)。

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
修改Rails默認(rèn)生成的Gemfile的source
整理Ruby相關(guān)的各種概念(rvm, gem, bundle, rake, rails等) | Henter
Gitlab搭建錯(cuò)誤匯總
在Windows下安裝Redmine,上海軟件開(kāi)發(fā)|上海軟件開(kāi)發(fā)公司|軟件定制|ERP開(kāi)發(fā)...
懶惰的程序員: gitorious
ActiveScaffold本地化
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服