Forum: Ruby on Rails require file in rails

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Kaushik katari (Guest)
on 2008-12-15 02:51
(Received via mailing list)
I have a file called dbcon.rb that I put in the config directory.

I want to call it from rake, and I was using
require 'config/dbcon.rb'

This was allowing me to access the classes in this file.

Somehow, the require command cannot find this file anymore. Is there a
convention in rails? How do I use require from different parts of my

Mark Reginald J. (Guest)
on 2008-12-18 03:15
(Received via mailing list)
Kaushik katari wrote:
> my application?
You could move it to the lib directory, or write
   require "#{RAILS_ROOT}/config/dbcon.rb"

Rails Wheels - Find Plugins, List & Sell Plugins -
This topic is locked and can not be replied to.