The initial behavior of require before Rubygems was to search all the directories listed in the $LOAD_FILES variable for the file and load the first match found. If no matching file is found, require will raise a LoadError value.
Rubygems modifies this process. With Rubygems, require will look for the existing $LOAD_PATH , as before, but if no matching file is found, Rubygems will look for installed stones on your machine to match. If a gem is found containing the corresponding file, this pearl is activated, and then the search for $LOAD_PATH repeated. The main effect of activating the gem is that the lib stones catalog has been added to your download path. Thus, a second search of the download path will find the required file.
Usually this will mean that the latest version of the gem you installed is activated. Sometimes you want to use a different version of the gem, and you can use the gem method for this. The gem method activates the gem, and you can specify the version you need, but do not require any files. When you later request the files you need, you will get them from the gem version you specify.
source share