在我看来,PATH列出了直接来自gemspec的第一代依赖项,而GEM列出了第二代依赖项(即依赖项依赖于什么)和来自Gemfile的依赖项。PATH::remote is。因为它依赖于当前目录中的本地gemspec来查找属于PATH::spec的内容,而GEM::remote是rubygems.org,因为这是它必须去查找属于GEM::spec的内容的地方。
在Rails插件中,你会看到PATH部分,但在Rails应用程序中看不到。因为应用程序没有gemspec文件,所以PATH中没有任何东西可以放。
至于DEPENDENCIES, gembundler.com声明:
Runtime dependencies in your gemspec are treated like base dependencies,
and development dependencies are added by default to the group, :development
由rails插件new my_plugin生成的Gemfile说了类似的话:
# Bundler will treat runtime dependencies like base dependencies, and
# development dependencies will be added by default to the :development group.
这意味着两者之间的区别
s.add_development_dependency "july" # (1)
and
s.add_dependency "july" # (2)
is that (1) will only include "july" in Gemfile.lock (and therefore in the application) in a development environment. So when you run bundle install, you'll see "july" not only under PATH but also under DEPENDENCIES, but only in development. In production, it won't be there at all. However, when you use (2), you'll see "july" only in PATH, not in DEPENDENCIES, but it will show up when you bundle install from a production environment (i.e. in some other gem that includes yours as a dependency), not only development.
这些只是我的观察,我不能完全解释为什么会是这样,但我欢迎进一步的评论。