Why use GemSpec + GemFile when checking for dependencies?

ruby, ruby-on-rails, ruby-on-rails-3, rubygems

Solution

Well that's because the `Gemfile` isn't a file from Rubygems, but a file from Bundler. So the Rubygem developers would have to extend their used files in order to support Gemfile. Since there already is the `.gemspec` file, there is no valid reason why they should. (there are enough gems which do well without a `Gemfile`)

In fact, it is recommended to use this as the only contents of the `Gemfile` of gems:

source 'https://rubygems.org'
gemspec

It will instruct bundler to use the `.gemspec` file as the authorative source of gems.

Problem

Whenever developing gems, I don't see any reasons why Gemfile is not directly inspected for dependencies. Indeed, why use a `.gemspec` file in order to list them ? Is there a real benefit ?

Original source