2013-03-28 44 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列表,包括所有依賴項。