rails 3.2使用的默认gem

时间:2013-03-28 06:53:11

标签: ruby-on-rails ruby ruby-on-rails-3.2

我是rails的新手。我只是在进行Bundle安装,并注意到Rails需要很多宝石才能启动。

我只是想知道是否每次都安装了rails安装的默认Gems列表。

我知道这听起来有点奇怪,但我想了解它。

3 个答案:

答案 0 :(得分:3)

我理解你的困惑,所以让我解释一下。默认情况下,您的Gemfile只需要几个gems,其中包含rails。但是你会看到在新的bundle install上安装了数十个宝石。 事实上,宝石通常依赖于其他宝石,而它们又可能依赖于其他宝石。例如,转到rubygems.org并查找rails gem。在那里你会看到这个宝石的依赖关系。通过访问每个依赖的gem,您将看到它们各自的依赖关系。

Bundler在创建要使用的完整宝石列表时构建数据结构,此数据结构称为依赖图。一旦它具有这种数据结构,它就会创建一个Gemfile.lock - 一个特殊的快照依赖文件,其中包含所有应用程序所需的宝石。

答案 1 :(得分:1)

Ruby gem是一个增强Ruby编程语言特性和功能的插件。以下是预安装的Ruby gem的列表:

actionmailer (1.2.1) - Service layer for easy email delivery and testing
actionpack (1.12.1) - Web-flow and rendering framework putting the VC in MVC
actionwebservice (1.1.2) - Web service support for Action Pack
activerecord (1.14.2) - Implements the ActiveRecord pattern for ORM
activesupport (1.3.1) - Support and utility classes used by the Rails framework
fcgi (0.8.6.1) - The fcgi gem facilitates FastCGI, which we use in concert with mod_fastcgi to accelerate your Ruby on Rails applications
gruff (0.1.2) - A library for making graphs
mysql (2.7)/pg - The MySQL/PG Ruby gem allows you to connect to and use MySQL/PG databases. We fully support MySQL/PG and the Ruby bindings to it.
rails (1.1.2) - The Ruby on Rails package
rake (0.7.1) - Ruby based make-like utility, required by many Ruby applications and gems.
rmagick (1.10.1) - RMagick allows you to use the ImageMagick and GraphicsMagick libraries, similar to GD support in PHP or Perl.

另外

gem 'carrierwave'

gem 'devise'

答案 2 :(得分:1)

运行bundle install后,将生成Gemfile.lock文件。

Gemfile.lock包含应用程序中使用的所有gem的列表,包括所有依赖项。