简体   繁体   中英

how to tell which gem causes dependency on another (uninstalled) gem?

How can I tell why a particular gem is getting installed when I install another gem?

That is, is there an easy way to find out where the dependency comes from? The gem install fails, so gem dependency doesn't work since it only handles installed gems. that's why I want to track down the dependency, it's breaking the install, and doesn't seem like it should be necessary.

Is there a tool that helps track dependencies between gems that have not yet been installed? Maybe a secret bundlerswitch that prints a dependency tree?

UPDATE They just released a new version of twitter-bootstrap-rails that eliminates the problem. Still, it would be useful if there were a way to track dependency graphs of uninstalled gems.

Here is the command that fails, running on Windows with JRuby

gem install twitter-bootstrap-rails

Somehow this causes an old version of a libv8 gem to be installed, which then fails to install. twitter-bootstrap-rails doesn't list libv8 in it's gem_spec, only therubyrhino and less-rails, which depend on others and others ... Somebody eventually depends on an old version of libv8 (v3.3.10.4). The question is which gem causes the dependency on libv8?

Here's my environment.

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.15
  - RUBY VERSION: 1.9.2 (2012-02-22 patchlevel 312) [java]
  - INSTALLATION DIRECTORY: c:/jruby-1.6.7/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: c:/jruby-1.6.7/bin/jruby.exe
  - EXECUTABLE DIRECTORY: c:/jruby-1.6.7/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-java-1.7
  - GEM PATHS:
     - c:/jruby-1.6.7/lib/ruby/gems/1.8
     - c:/Users/alex/.gem/jruby/1.9
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "install" => "--no-rdoc --no-ri --env-shebang"
     - "update" => "--no-rdoc --no-ri --env-shebang"
  - REMOTE SOURCES:
     - http://rubygems.org/

If you can install it under MRI, you can use gemviz to show the dependency graph like this:

gemviz twitter-bootstrap-rails

It should be possible to do that with gems that are not installed (there has to be a website that does this), but gemviz can't do that.

Edit: Here's the dependency graph:

twitter-bootstrap-rails gem依赖图

So therubyracer depends on libv8 . A lot of dependencies there..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM