2013-03-28 62 views
1

我是rails.I的新手,我只是在做Bundle安装,并注意到有很多gem需要Rails启动。rails使用的默认宝石3.2

我只是想知道是否有列表的安装轨道安装每次默认的宝石。

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

+0

您是否安装了RubyGem包 – 2013-03-28 06:55:55

+2

您可以在Gemfile中看到默认宝石列表,并且所有与默认宝石相关的gem列表都列在Gemfile.lock中。 – 2013-03-28 07:00:31

回答

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' 
3

我明白你的困惑,所以让我解释一下。默认情况下,您的Gemfile只需要一些宝石,其中包括一些轨道。但你会看到几十个安装在新鲜的bundle install上的宝石。 问题是宝石通常依赖于其他宝石,而它们又可以依赖于其他宝石。作为例子,去rubygems.org并寻找rails宝石。你会看到这个宝石的依赖关系。通过去每个相关的宝石,你会看到他们各自的依赖关系。

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

+0

谢谢你的帮助@Valentin Vasilyev – Catmandu 2013-03-28 06:59:50

+1

@PeeVee:你必须搜索/采取那些有助于建立你的应用程序的宝石。移除其余的无用宝石。有些宝石对其他宝石有依赖性。所以你应该知道去除任何宝石之前。 – Rubyist 2013-03-28 07:02:35

1

运行bundle install后,会生成一个Gemfile.lock文件。

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