1

I've seen some syntax where

group :development, :test do
  gem "rspec-rails", ">= 2.0.0.beta.19"
  gem "cucumber-rails", ">= 0.3.2"
  gem "webrat", ">= 0.7.2.beta.1"
end

or

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

or

group :production do
  # gems...
end

or

group :db do
  # gems..
end

Are there problems with just doing bundle install with ALL the gems? Why do people want to leave out gems? Wouldn't it just be easier if everything was installed all together?

4

2 回答 2

4

Group's 主要用于主要用于环境的 gem 隔离。假设在开发环境中,我们希望pry在生产中我们不会做任何调试任务,所以我们不需要 pry 以获取更多信息您可以参考yehuda博客

于 2013-03-23T17:55:38.560 回答
2

重建一个包含大量 gem 的大型项目可能需要几分钟时间。您可以通过仅构建需要的内容来减少构建时间。

于 2013-03-23T18:01:09.327 回答