picardo picardo - 4 months ago 14
Ruby Question

How can I require libraries in your Rails directory from the console?

I have a script called query.rb in my lib directory. I want to require it so I can run it from the Rails console. I wonder if this is possible. The script work fine from within the application, so I know it's well formed and functional.

cam cam
Answer
require "#{RAILS_ROOT}/lib/query"