Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
354 views
in Technique[技术] by (71.8m points)

ruby on rails - How do I find out which gem has a specific dependency?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...