如何从Gemfile中查看依赖关系树? [英] How to see the dependency tree just from Gemfile?

查看:122
本文介绍了如何从Gemfile中查看依赖关系树?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行 bundle install时出现以下错误

 确保在捆绑之前`gem install couchbase -v'1.3.3'`成功。 

现在,我没有在 Gemfile ,所以它来自一些依赖。



由于 bundle install 失败,我不知道该如何确定哪个gem依赖于此couchbase gem?没有 Gemfile.lock 来找出这个依赖关系。

解决方案

gem dependency (不带任何参数)应该显示当前Gemfile及其依赖关系中的所有宝石。

编辑:



您也可以执行 gem dependency -R (或者只是 dep insted of dependency ),如果你想找出哪些宝石使用特定(或全部)宝石。



对于更深的依赖关系,我会解析第一个gem依赖关系的输出(regex也许?),选择gem的名字并调用 gem dep ,但这只是一个松散的想法。


I am getting the following error when doing bundle install

Make sure that `gem install couchbase -v '1.3.3'` succeeds before bundling.

Now, i have not included this gem in the Gemfile, so it's coming from some dependency. How can i figure out which gem is dependent on this couchbase gem?

Since bundle install is failing and I don't have Gemfile.lock to figure out this dependency.

解决方案

gem dependency (with no args) should show you all gems from current Gemfile with their dependencies.

Edit:

You can also do gem dependency -R (or just dep insted of dependency) if you want to find out which gems use specific (or all) gems.

For deeper dependencies I'd parse output (regex maybe?) of first gem dependencies, pick gem's names and call gem dep on each of them, but that's just a loose idea.

这篇关于如何从Gemfile中查看依赖关系树?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆