[Rubygems-developers] gem list as input to gem install?

John Trupiano jtrupiano at gmail.com
Mon Feb 1 13:56:08 EST 2010


Hugh, I've actually got a library (not published yet) that will run an
arbitrary set of ruby code and tell you which gems it activated.  Give me a
few moments to get it pushed up to GitHub and I'll respond back with some
details.

-John

On Mon, Feb 1, 2010 at 1:31 PM, Hugh Sasse <hgs at dmu.ac.uk> wrote:

>
>
> On Mon, 1 Feb 2010, Chad Woolley wrote:
>
> > On Mon, Feb 1, 2010 at 10:31 AM, Hugh Sasse <hgs at dmu.ac.uk> wrote:
> > > Yes, that would do the job. I think I'm correct in thinking
> > > geminstaller --config=/dev/null --print-rogue-gems
> > > would do the job, as well?
> >
> > No, probably not.  Plus, I wouldn't recommend actually using this,
> > since I plan to deprecate GemInstaller in favor of Bundler.  I was
> > just giving it as an example of your request, so I could point out how
> > Bundler is superior.
>
> I see.
> >
> > >> However, I believe Bundler is a better way to solve these problems.
> > >> People should be specifying gems on a per-app or per-environment basis
> > >> instead of relying on system gems anyway.
> > >
> > > Yes, that would be the ideal case, but wouldn't cover the bug hunting
> > > case from malformed dependencies or the complete rebuild case.
> >
> > Not sure what you mean by malformed dependencies.  In the rebuild
> > case, you would just install ruby and rubygems, then run Bundler for
> > the specified project/environment.
>
> OK, maybe a concrete example would help.
> Currently on my system I get the following for reek, when trying to
> see what rake targets I have:
>
> hgs at Q2P14HGS ~/reek1/reek
> 18:17:42$ rake --trace -T
> (in /home/hgs/reek1/reek)
> rake aborted!
> undefined method `sexp_type' for class `Sexp'
> /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.0.4/lib/ruby_parser_ext
> ras.rb:1025
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /usr/lib/ruby/gems/1.8/gems/ruby_parser-2.0.4/lib/ruby_parser.rb:
> 12
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/source/source_code.rb:1
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/source/core_extras.rb:1
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/source.rb:3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/smells/control_couple.rb:3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/smells.rb:4
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/sniffer.rb:3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/module_context.rb:3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/class_context.rb:1
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/code_parser.rb:3
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> /home/hgs/reek1/reek/lib/reek/sniffer.rb:2
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem
> _original_require'
> /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `req
> uire'
> ./tasks/develop.rake:2
> /home/hgs/reek1/reek/Rakefile:15:in `load'
> /home/hgs/reek1/reek/Rakefile:15
> /home/hgs/reek1/reek/Rakefile:15:in `each'
> /home/hgs/reek1/reek/Rakefile:15
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
>
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_l
> oad_rakefile'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_
> rakefile'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `stand
> ard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_
> rakefile'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `stand
> ard_exception_handling'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
> /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
> /usr/bin/rake:19:in `load'
> /usr/bin/rake:19
>
> hgs at Q2P14HGS ~/reek1/reek
> 18:17:56$
>
> 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 think what I propose would do this.  I'm not entirely sure if I have
> covered the case where the gems are in one's .gem directory, or not, but
> since I proposing to use the existing search mechanisms for this, I think
> that would be covered.
>
> On the other hand, I don't see how Bundler would help with this.  [Which
> is fair enough, it is outside the scope of its design (for recording
> gems on a per project basis)].
>
> >
> >
> > >> Future versions of Bundler will also allow you to version and save the
> > >> entire dependency tree as Bundler has resolved it (without requiring
> > >> you to check in .gem files in cache dir, as is currently the case).
> > >
> > > So the versions of the version tree can go into git, etc?
> >
> > Yes.  Bundler resolves the entire dependency tree at development-time.
> >  Currently you persist this by checking in the selected .gem files in
> > the cache dir.  Future versions will allow you to persist this without
> > having to check in .gem files.
>
> Yes, this would be a good thing, but different from my existing problem.
> >
> > -- Chad
>
>        Thank you,
>         Hugh
> _______________________________________________
> Rubygems-developers mailing list
> http://rubyforge.org/projects/rubygems
> Rubygems-developers at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rubygems-developers
>


More information about the Rubygems-developers mailing list