[Rubygems-developers] Config clash

Gavin Sinclair gsinclair at soyabean.com.au
Tue Sep 14 22:33:09 EDT 2004


I've just dicovered an anti-social behaviour of RubyGems.  I'm mucking
around with 'acoc' (look on RAA).  It defines a class called Config:

  class Config < Hash; end

If I insert

  require 'rubygems'
  require_gem 'rake'

at the top of the 'acoc' file, I get this error when running it:

  /usr/local/bin/acoc:88: Config is not a class (TypeError)

That's because RubyGems defines a top-level Config (almost certainly by
loading 'rbconfig').  A quick

  p Config.class

in the code confirms that it's a Module.


Now.  'acoc' is old and was not designed to work with RubyGems.  But I
don't like the fact that it stops working just because I load a gem.  (The
choice of rake was arbitrary and immaterial.)

Is there anything we can do to prevent this?

Gavin




More information about the Rubygems-developers mailing list