I need to get the current working directory of a gem from within a Rails application.
I currently use
`bundle show foo`.strip
This works great in my environment, but:
- it's slow because it requires loading a shell
- it will probably break when somebody tries to run the app on Windows or on JRuby or when their $PATH points at a different ruby than the one used to start the app
So I'd like a way to do this without invoking a subshell.
The RDOC for Bundler hasn't been helpful. You used to be able to get this sort of information from Rails itself in Rails 2, but it appears that Rails 3 lets Bundler handle it.