On Aug 31, 10:48 am, mjskier <[email protected]> wrote: > After pulling my hair trying to understand why my test script failed > when run from the local directory but worked fine when invoked from > somewhere else, I realized that I had a test script called sequel.rb > in my test directory... > Not sure if gem uses PATH to locate gems, but obviously it was picking > the local sequel.rb instead of the gem one.
This is expected in ruby versions before 1.9. Starting with 1.9, gem directories are automatically in the load path before the current directory by default, and starting with 1.9.2, the current directory is no longer in the load path by default. On ruby 1.8, the way gem requiring works is that it uses the standard require, and if that fails, tries to find the desired file in a gem. Since the require 'sequel' with sequel.rb in the current directoy would find that file, the gem requiring never gets invoked. You can work around it by calling gem 'sequel' before requiring sequel (to add the gem directory to the load path before the current directory), but the better solution is to just rename the file in the current directory. Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
