Search code examples
ruby-on-railsgemfile

which group did you put these gems in?


i noticed some people puts rspec-rails to development group, some puts it in development and test group, why? and for these common gems,

gem 'faker'
gem 'populator'
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'guard-spork'
gem 'guard-rspec'
gem 'spork-rails'
gem 'capybara'
gem 'database_cleaner'
gem 'email_spec'
gem 'pry-rails'

which group do you put and the reason is ?

is there any clear guides about this?

for example, i only put 'pry-rails' in development group, because i don't need to load it in test group, i use it only for debugging something in development

thanks!


Solution

  • Put them exactly where you need them.

    Most of those are test-related gems and as such should be loaded just into the test group, but some (such as factory_girl, faker and pry-rails) may also be useful in the development group – for example, you could use FactoryGirl to populate a fake development environment.