I would like to get a list of the paths of configured gems.
A list of gem dependencies can be found by:
Rails.configuration.gems
…which returns a bunch of Rails::GemDependency but I can’t figure
out how to get a path to the root of the gem.
I can get the gem root from ENV[‘GEM_HOME’] but I can only get the
name of the gem and the version requirement from the GemDependency.
The version requirement isn’t necessarily the same version that is
being loaded, since it could be a >= requirement.
Any suggestions?
For what it’s worth, I’m trying to hack something that will auto-load
rake tasks from configured gems.
The ultimate problem is that Rake doesn’t (by default) actually load
the Rails environment (tasks can, by specifying a dependency on
the :environment task). So the gems aren’t “configured” by default.
The same problem pops up when trying to load generators from vendor/
gems.