Gemfile Dependencies in Rails
In a Rails application, if one of the gems included in the Gemfile depends on another that I want to use, do I need to include the second in the Gemfile?
Let's say I am using a gem cucumber-rails
. Upon running bundle dependency cucumber-rails
, I see that it depends on "database_cleaner" and factory_girl
. Do I need to include the first two in the Gemfile or not?
Thank!
source to share
If you are using bundler then it will install any dependency when installing gem
you can see the dependencies in gemfile.lock
but note that having a dependency installed is not always a good idea to assume that the installed dependency is the version of the gem you want. The installed dependency is the version required for the gem to work. If you want the factory-girl in the latest version (or any other version) then it is best to include it ingemfile
source to share