获取Bundler项目正在使用的宝石列表 [英] Get list of gems being used by a Bundler project
本文介绍了获取Bundler项目正在使用的宝石列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法让Bundler(这是一个Rails 3)项目为当前项目加载的宝石或路径列表。
我正在寻找类似的东西:
Gem.path
,但是它只返回Bundle在Gemfile中主动要求的那些内容。
解决方案
Gem.loaded_specs.values.map {| g | g.full_gem_path}
Is there a way to get the list of gems or paths to gems that are being loaded for the current project by Bundler (it's a Rails 3) project.
I'm looking for something like:
Gem.path
but that returns only the ones being actively required by Bundler in the Gemfile.
解决方案
What I was looking for was this:
Gem.loaded_specs.values.map { |g| g.full_gem_path }
这篇关于获取Bundler项目正在使用的宝石列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文