简体   繁体   English

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

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

I commented out a gem, but 'bundle install' still won't run.我注释掉了一个 gem,但“捆绑安装”仍然无法运行。 How do I find out which gem has a dependency on sys-proctable?如何找出哪个 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

In the bash shell you can do:在 bash shell 中,您可以执行以下操作:

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

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 .您始终可以在rubygems.org上检查 gem 的反向依赖关系。 There's a link on the right side panel on the website.网站右侧面板上有一个链接。

在此处输入图片说明

Or you can visit the site或者您可以访问该网站

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

So, in your case所以,在你的情况下

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

How do I find out which gem has a dependency on sys-proctable?如何找出哪个 gem 依赖于 sys-proctable?

Try the bundler-why plugin (inspired by yarn why )试试bundler-why插件(灵感来自yarn why

bundler plugin install bundler-why
bundle why tzinfo
# ransack -> activesupport -> tzinfo
# rspec-rails -> activesupport -> tzinfo
# business_time -> tzinfo

gem dependency --reverse-dependencies will traverse a single edge of the paths . gem dependency --reverse-dependencies将遍历路径的单个边缘 In comparison, bundle why will traverse all edges.相比之下, bundle why会遍历所有边。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法激活gem:如何确定哪个gem依赖于此gem? - Can't activate gem: how do I figure out which gem has a dependency on this one? Rails 5:我如何找出哪个 Gem 取决于特定的 Ruby 版本? - Rails 5: How Do I Find Out Which Gem Depends on a Specific Ruby Version? 我如何找出导致特定宝石捆绑在一起的宝石? - How do I figure out which gem(s) caused a particular gem to be bundled? 如何停用特定版本的gem? - How do I deactivate a specific version of gem? 如何找出哪个样式取代另一个样式? - How do I find out which style is overriding another style? 捆绑包想要安装旧版本的gem ---我如何找出原因? - bundle wants to install an old version of a gem---how do I find out why? 如何使用rubyzip gem在压缩目录中找到特定条目? - How do I find a specific entry inside a zipped directory using the rubyzip gem? 如何在 Rails 3(捆绑器)中解决这个 gem 依赖问题? - How do I fix this gem dependency problem in Rails 3 (bundler)? 我如何找出哪个版本的宝石适合哪个版本的红宝石和铁轨? - How do I find out which version of gems is suitible for which versions of ruby and rails? 如何找出哪个Ruby gem劫持了ActiveRecord关联方法 - How to figure out which Ruby gem has hijacked an ActiveRecord association method
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM