84

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

Chloe
  • 25,162
  • 40
  • 190
  • 357
  • 1
    The Gemfile.lock normally shows you your dependencies, but I'm not sure it's generated yet for you since the bundler didn't complete successfully. – Richard Brown Feb 26 '13 at 00:27

3 Answers3

135

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))
pevik
  • 4,523
  • 3
  • 33
  • 44
fmendez
  • 7,250
  • 5
  • 36
  • 35
  • That didn't work. `gem dependency --pipe sys-proctable` printed `test-unit --version '>= 2.4.0'`, but that gem isn't in my Gemfile either: `grep test-unit Gemfile`. – Chloe Feb 26 '13 at 00:35
  • 2
    @Chloe could you try this then: gem dependency sys-proctable --reverse-dependencies, I added the reverse dependency option to the command. – fmendez Feb 26 '13 at 00:46
  • Yes! That works! `Used by guard-spork-1.2.0 (sys-proctable (>= 0))` – Chloe Feb 26 '13 at 05:46
  • 4
    For me it worked only when specifying ``-b`` parameter ("``-b``, ``-​-both`` - Allow LOCAL and REMOTE operations") – kolen Feb 10 '16 at 00:04
  • 6
    This doesn't work if the gem is not actually installed. – Mark Reed Oct 19 '16 at 16:00
8

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.

enter image description here

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_dependencies

Deepak Mahakale
  • 22,834
  • 10
  • 68
  • 88
5

How do I find out which gem has a dependency on sys-proctable?

Try the bundler-why plugin (inspired by 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. In comparison, bundle why will traverse all edges.

Jared Beck
  • 16,796
  • 9
  • 72
  • 97