From a running rails app is there a way to enumerate the list of dependencies for the application? Assume I don't have access to the Gemfile or Gemfile.lock files.
I need the gem name and the version number so something like:
[["actionmailer" "3.1.3"]
["coffeescript" "2.0.2"]]
Assuming bundler, which you should use, you can access it like this:
Bundler.environment.current_dependencies
#=> [<Bundler::Dependency type=:development name="minitest" requirements=">= 2.11.0">,
<Bundler::Dependency type=:development name="rspec-expectations" requirements=">= 2.7.0">,
<Bundler::Dependency type=:development name="mocha" requirements=">= 0.10.0">,
<Bundler::Dependency type=:development name="cucumber" requirements=">= 1.1.4">]