且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何找出哪个gem具有特定的依赖关系?

更新时间:2023-12-06 14:04:40

在bash shell中,您可以执行以下操作:

例如:

  gem dependency activesupport --reverse-dependencies 依赖项
Gem activesupport-2.3.14

使用actionpack-2.3.14(activesupport(= 2.3.14))
activerecord-2.3.14(activesupport(= 2.3。 14))
activeresource-2.3.14(activesupport(= 2.3.14))
...


I commented out a gem, but 'bundle install' still won't run. How do I find out which gem has a dependency on sys-proctable?

$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Could not find sys-proctable-0.9.2 in any of the sources

$ grep proctable Gemfile
  #gem 'sys-proctable', '0.9.2', :path => "vendor/gems"

$ bundle list
Resolving dependencies...
Could not find gem 'rspec-rails (= 2.11.0) ruby' in the gems available on this machine.

$ bundle viz
Resolving dependencies...
Could not find gem 'rspec-rails (= 2.11.0) ruby' in the gems available on this machine.

$ bundle -v
Bundler version 1.3.0

$ ruby -v
ruby 1.9.3p385 (2013-02-06 revision 39114) [i386-cygwin]

Gemfile: http://pastebin.com/9WWMfKtv

I've already tried these troubleshooting steps: https://github.com/carlhuda/bundler/blob/1-2-stable/ISSUES.md

In the bash shell you can do:

gem dependency name_of_the_gem --reverse-dependencies, for instance:

gem  dependency  activesupport --reverse-dependencies                               
Gem activesupport-2.3.14
Used by
actionpack-2.3.14 (activesupport (= 2.3.14))
activerecord-2.3.14 (activesupport (= 2.3.14))
activeresource-2.3.14 (activesupport (= 2.3.14))
...