From: George Ogata Date: 2006-12-04T11:24:53+09:00 Subject: Re: On Modules and require in general / on ActiveSupport in particular On 12/3/06, nrolland wrote: > #initial state > require 'rubygems' > => true > a = Module.constant Hmmm, I'm not sure where you got #constant from... it's usually #constants . > # I load ActiveSupport, nothing gets loaded !!!!! > require_gem 'activesupport' > => true > c = Module.constant > c -b > => [] AFAIK, #require_gem isn't normally used anymore. What it does is add the gem directory to the load path, and then require all its "autorequires". Problem is, activesupport doesn't specify any autorequires, so it doesn't do anything. I believe usually, you just "require 'rubygems'", and then require files in any gems as you need them. In activesupport's case, you want the file named 'active_support.rb'. So this should do the trick: require 'rubygems' require 'active_support' Even more commonly, requiring rubygems is done through the RUBYOPT environment variable (set it to 'rubygems'), and not in the code itself. This way, you don't rely on the library being provided through a gem. > (d - c).find_all { |t| t.downcase.include?("active")} > => ["ActiveSupport", "ActiveRecord"] Shorter: (d - c).grep(/active/i) :-)