Error: cannot load such file

Hello,

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"]        }      formatted

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

Do I need to do something to the files themselves?

Thanks DC

Whoops, stupid error...

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

Thanks anyway

DC

config.autoload_paths

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

Rails.root is what we use in rails 2