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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15079090/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 21:28:37  来源:igfitidea点击:

How do I find out which gem has a specific dependency?

ruby-on-railsrubygembundler

提问by Chloe

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?

我注释掉了一个 gem,但“捆绑安装”仍然无法运行。如何找出哪个 gem 依赖于 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

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

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

我已经尝试过这些故障排除步骤:https: //github.com/carlhuda/bundler/blob/1-2-stable/ISSUES.md

回答by fmendez

In the bash shell you can do:

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

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

gem dependency name_of_the_gem --reverse-dependencies, 例如:

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))
...

回答by Deepak Mahakale

I know this answer includes a link, but this is not a link specific answer

我知道这个答案包含一个链接,但这不是特定于链接的答案

You can always check the reverse dependencies of a gem on rubygems.org. There's a link on the right side panel on the website.

您始终可以在rubygems.org上检查 gem 的反向依赖关系。网站右侧面板上有一个链接。

enter image description here

在此处输入图片说明

Or you can visit the site

或者您可以访问该网站

https://rubygems.org/gems/{gem_name}/reverse_dependencies

https://rubygems.org/gems/{gem_name}/reverse_dependencies

So, in your case

所以,在你的情况下

https://rubygems.org/gems/sys-proctable/reverse_dependencies

https://rubygems.org/gems/sys-proctable/reverse_dependencies