picardo picardo - 1 year ago 75
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 Source
require "#{RAILS_ROOT}/lib/query"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download