如何在运行时检查Ruby中的Gem版本? [英] How do you check the Gem Version in Ruby at Runtime?
本文介绍了如何在运行时检查Ruby中的Gem版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在调试过程中,我希望能够做一些事情例如:
puts RubyGem.loaded_version(:active_support)
类似这样的东西存在吗?
解决方案
puts Gem.loaded_specs [activesupport]。version
Is it possible to check the gem version of the currently loaded gem in a ruby/rails app?
During debugging, I would like to be able to do something like:
puts RubyGem.loaded_version(:active_support)
Anything like that exist?
解决方案
puts Gem.loaded_specs["activesupport"].version
这篇关于如何在运行时检查Ruby中的Gem版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文