14 Mar '13, 7am
Still true since 2007 @jimweirich: "Activating a gem should be done once in centrally organized location. Requiring..
>> The #gem call activates the gem, and the require is the regular >> require to load a library. > > What is the difference between an "active" gem and a gem that has been > "loaded". In short: Gems are activated (i.e. selected and made available). Files are loaded. The long description: The 'require' command loads files by searching for the file name in a list of directories (called the load path). If a file is in one of the directories in the load path, it is loaded into the Ruby program. By default, the files in a Gem are not in the load path used by Ruby. RubyGems extends the standard 'require' command so that if a file is not found, the latest gem containing that file will activated (see below). When a gem is activated, the load path used by Ruby is adjusted so that the files in the gem will be in the load path. Then Ruby can find any file in that gem. The only time y...