From: Eugen Ciur Date: 2011-05-02T18:40:25+09:00 Subject: Re: LoadPath and require confusion, please explain Lucky Dev wrote in post #996171: > But when i say require "something" , something.rb should be present in > the loadpath for the require call to return success.... > Nope. Look, when we require arel (for example), although it is not in $LOAD_PATH, ruby will use paths provided by gem library (as I said in post before) to find where is arel localted. $ ruby -e "puts require 'arel'" true If has found 'arel' library (my load_path is almost same as your - no arel there) But, when we disable gems as in command below: $ ruby -e "puts require 'arel'" --disable-gems -e:1:in `require': no such file to load -- arel (LoadError) from -e:1:in `
' Ruby fails to find arel library, because it ignores $GEM_HOME and $GEM_PATH this time, and search only in $LOAD_PATH. '--disable-gems' option is your answer. ---- http://blog.eugen.co -- Posted via http://www.ruby-forum.com/.