Error: cannot load such file


I am again looking for some guidance as an inexperienced programmer. I
appreciate the help. I would like to run a number of ruby files from
within rails. They are all different, but return information in a hash
(gen_output) in a standard format that my model in rails needs to use.
I am storing the files in a folder in "lib". The files can be as basic
as 1+2+3, with 3 being returned in the hash.

This is in my model:
require 'lib/generators/parks_bielkowski_test.rb'

     formatted = {
       :complete_question => gen_output["complete_question"]

I get this error:
cannot load such file -- lib/generators/parks_bielkowski_test.rb

Do I need to do something to the files themselves?


Whoops, stupid error...

require "#{RAILS_ROOT}/lib/generators/parks_bielkowski_test.rb" works!

Thanks anyway



should include ‘lib’ to load you code - it is strange that this isn’t happening.

Rails.root is what we use in rails 2