Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find gems that depend on a given gem?

Tags:

ruby

rubygems

Is it possible to search for all gems that rely on a certain rubygem?

For example, I'd like to ask for all gems in gemcutter that rely on the test-unit gem.

Background: I'm looking to see how other gems handle the issue mentioned here.

like image 682
Andrew Grimm Avatar asked Nov 07 '09 22:11

Andrew Grimm


People also ask

How do I resolve gem dependencies?

Common Attempts To Resolve Ruby Gem Dependencies Bundler can help to resolve dependencies when working with Ruby gems by allowing you to specify a set of gems in a Gemfile, then issue a single command to install them. Bundler then automatically resolves the dependencies for you.

What is a gem dependency?

development. RubyGems provides two main “types” of dependencies: runtime and development. Runtime dependencies are what your gem needs to work (such as rails needing activesupport). Development dependencies are useful for when someone wants to make modifications to your gem.

Which is the command used to list all the gems available in Ruby?

The list command is used to view the gems you have installed locally.

What is gem CLI?

Command Line Interface gem allows you to quickly specify command argument parser that will automatically generate usage, handle stdin, switches, options and arguments with default values and value casting.


1 Answers

I had the same problem, and found that some of the other suggestions for this question are now defunct. I came up with a 2-step solution that worked for me.

The following unix-y script will tell you all the gems your gems depend on:

gem list | egrep '^.*[ ]' -o | gem dependency

Then I just searched for the culprit in the output.

like image 195
Jason Avatar answered Oct 15 '22 11:10

Jason