Rvm,gems,rubygems,bundle,gemfile,git,rake,
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环境,帮你管理多个Ruby环境,帮你管理你开发的每个Ruby应用使用机器上哪个Ruby环境。Ruby环境不仅仅是Ruby本身,还包括依赖的第三方Ruby插件。都由RVM管理。
保证了两个一致性:1.开发、测试、生产环境的基础Ruby环境一致。2.各个版本的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)?.
可以叫做组件、库或包,里面包含了该组件运行所必需的各种文件和信息。当你用该第三方组件,你知道它是可靠的,因为它用清晰的结构自我描述,。
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定义了包的结构,RubyGems是个工具,帮你管理单个包,包括搜索、安装、创建一个gems。他和RVM的区别在于:RVM维护一组gems,仿佛是一个基线,让这一组gems是彼此匹配的,而RubyGems帮你维护一个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 相当于多个RubyGems批处理运行。在配置文件gemfilel里说明你的应用依赖哪些第三方包,他自动帮你下载安装多个包,并且会下载这些包依赖的包。
gemfile:定义你的应用依赖哪些第三方包,bundle根据该配置去寻找这些包。
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的一个在线的代码仓库,网址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,用于创建和执行某些任务。比如执行测试,比如创建 一个修改数据库的批处理任务。
将以上概念连接起来:
1.安装RVM :bash < <(curl -s )
2.用RVM安装出一个或多个Ruby环境:$ rvm install 1.9.2