Is there any way to tell which gems and plugins are loaded at runtime for a Rails process?

纵然是瞬间 提交于 2019-11-29 22:19:14

This should get you everything loaded through rubygems:

Gem.loaded_specs.keys

I don't know of a universal way to see which rails plugins are loaded, you can look at the source for Rails::Initializer (pre 3.0) & figure out what your version of rails is doing. Hopefully you know which plugins should be loading & can confirm that from the console when debugging.

With versions:

Gem.loaded_specs.values.map {|x| "#{x.name} #{x.version}"}
sreid

I think the above answers using Gem.loaded_specs.keys show the gems on the "load path".

However, you originally asked about gems loaded into memory, and this answer may be more helpful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!