[Rubygems-developers] gem list as input to gem install?
jtrupiano at gmail.com
Mon Feb 1 14:34:11 EST 2010
> On Mon, Feb 1, 2010 at 1:31 PM, Hugh Sasse <hgs at dmu.ac.uk> wrote:
>> Kevin Rutherford has been unable to reproduce this, even noting the
>> gems that show up in those diagnostics. Now, I'm not using Bundler,
>> so it will have no record of my setup. How do I export my
>> collection of gems in such a way that a setup with the same gems can
>> be installed on some machine? Then some things might be eliminated
>> from the enquiry.
I put the library up on GitHub: http://github.com/jtrupiano/gem_filer
Essentially you'll just want to use the bin/gemfiler script to run whatever
code you want to interrogate. If you're trying to get a list of the gems
your test environment activates when it's loaded, you should be able to run
this from the root of your rails project:
RAILS_ENV=test path/to/bin/gemfiler --rails
Note that this command will not actually run your tests, all it does is load
the test environment. So if you lazily require any of your test or app
dependencies (which is very possible), those may not get picked up.
Check out the README for various examples on how to use gem_filer. Note
that this library is very early stage and it's quite possible that I'll
never actually release it as a gem. However, seeing as you seemed to be
asking for some functionality that I believe it provides, I thought I'd
share it with you.
Also, take the opportunity to look under the covers. You'll find that
RubyGems itself provides me with gem activation data that I use to create
the Gemfile (via Gem.loaded_specs).
More information about the Rubygems-developers